To copy everything including:
attributes
comments
processing instructions
namespaces
text
we have to use greedier wild cards:
@*
to copy attribute nodes
node()
to copy all other nodes
<!-- pass unrecognized nodes along unchanged --> <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template>
The output is the same in this case, though for a document that used more HTML it might be different.