Please get rid of this awful code:
Code:
<xsl:template match="Ledger">
<xsl:text disable-output-escaping="yes"><![CDATA[<LEDGER>]]></xsl:text>
<xsl:value-of select="." />
<xsl:text disable-output-escaping="yes"><![CDATA[</Ledger>]]></xsl:text>
</xsl:template
The way to write this is:
Code:
<xsl:template match="Ledger">
<LEDGER>
<xsl:value-of select="." />
</LEDGER>
</xsl:template>
Of course if you do that, the start and end tags will have to match - but that's the point. There's an element node in the stylesheet called LEDGER, which is an instruction to add an element node to the result tree.
Get it into your head that XSLT outputs a tree of nodes, not a string of markup text.