XSLT conundrum solved

I had a moment of epiphany today about my XSLT problem – the answer is not to seek to append stuff to the end of the document, but to get the template right in the first place eg:

<xsl:template match=”/dataroot”>
<html>
<body>
<h2>Report</h2>
<div title=”Summaries”>
<xsl:apply-templates select=”Headlines” />
</div>
<div title=”Fulltext”>
<xsl:apply-templates select=”Headlines/Headline” /></div>
</body>
</html>
</xsl:template>
<xsl:template match=”Headlines”>
<h4><xsl:value-of select=”Headline” /></h4>
<br /><xsl:value-of select=”Summary” /><br />
<br /><a>
<xsl:attribute name=”href”>#
<xsl:value-of select=”Headline” />
</xsl:attribute>
Full Text
</a>
<br /><br />
</xsl:template>
<xsl:template match=”Headline”>
<br /><br /><a>
<xsl:attribute name=”name”>
<xsl:value-of select=”.” />
</xsl:attribute>
</a>
<xsl:value-of select=”../FullText” />
</xsl:template>
</xsl:stylesheet>