Hi,
I think you want to retrieve the name of the outermost XML element. This can be done like in the following XSL sample:
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="outermostElementName" select="name(/*)" />
<xsl:template match="/">
<xsl:value-of select="$outermostElementName"/>
</xsl:template>
</xsl:stylesheet>
Please note that there is a slight difference in XPath terminology:
The top of the tree is a root node
(1.0 terminology) or document node
(2.0). This is what "/" refers to.
It's not an element: it's the parent
of the outermost element (and any
comments and processing instructions
that precede or follow the outermost
element). The root node has no name.
See http://www.dpawson.co.uk/xsl/sect2/root.html#d9799e301