Try something like this ...
<xsl:template match="name">
<name>
<xsl:variable name="firstchild" select="name(body/*[1])"/>
<xsl:value-of select="$firstchild" />
</name>
</xsl:template>
Or, if you really don't need a variable, just ...
<xsl:template match="name">
<name>
<xsl:value-of select="name(body/*[1])" />
</name>
</xsl:template>
Here is the xmlplayground of the second example ... to see <name>para</name>click on View Sourcein the output window.
source
share