Listing XML nodes in XSLT

How to show the name/value of all nodes in an XML element using XSLT

Occassionally you don't know what XML data is being passed through to XSLT for process, so the following can be used to quickly show the data...

<xsl:for-each select="//mydata/*">
  <xsl:value-of select="name()"/> = <xsl:value-of select="."/><br/>
</xsl:for-each>

And if you need the attributes, simply add a @ character...

<xsl:for-each select="//mydata/@*">
  <xsl:value-of select="name()"/> = <xsl:value-of select="."/><br/>
</xsl:for-each>
Added 17/05/2022 15:32