A: 

You need just this XPath:

name(..)

This works if the context node is your selected attribute node.

Alejandro
+1  A: 
<xsl:value-of select="name()"/>

just returns the name of the attribute, but I need to select the name of the attribute's element.

The element to which an attribute belongs is considered its parent, therefore:

..

when issued with the context node being an attribute, selects the element to which this attribute belongs.

To find the name of this element, simply use the XPath name() function:

name(..)

when issued with the context node being an attribute evaluates to a string, which is the name of the element that holds that attribute.

Dimitre Novatchev