I have to transform a complex xml to html. Some nodes I can transform, but there are a lot of nodes with unknown meaning. here is simplified xml
<root>
<NodeWithKnownData>
<FirstElement>blah</FirstElement>
<SecondElement>blahBlah</SecondElement>
</NodeWithKnownData>
<NodeWithUnKnownData>
<FirstUnknownElement>blah2134</FirstUnknownElement>
<SecondUnknownElement>blahBlah324523</SecondUnknownElement>
</NodeWithUnKnownData>
<NodeWithRandomNatureData>
<KnownElement>blah2134</KnownElement>
<UnknownElement>blahBlah324523</UnknownElement>
<NewUnknownElement>
<KnownNode2>test</KnownNode2>
<KnownElement>
<KnownNode3>test5654</KnownNode3>
<UnknownNode>test2342345</UnknownNode>
</KnownElement>
</NewUnknownElement>
</NodeWithRandomNatureData>
</root>
I have templates only for known elements. And I have to use my templates and show unknown nodes as "name of node" : "value". Please help me.
Updated
A rule for distinguish known from unknown nodes - only templates for known nodes. if i use this template :
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xhtml" omit-xml-declaration="yes"/>
<xsl:template match="root">
<xsl:apply-templates select="/NodeWithKnownData"/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="*">
<xsl:value-of select="local-name()"/> : <xsl:value-of select="."/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="NodeWithKnownData">
some useful actions
</xsl:template>
</xsl:stylesheet>
every sub-node is recursevily repeated.