Well, one way would be:
<xsl:template match="/" >
<html>
<body>
<xsl:apply-templates/>
<h2>Notes</h2>
<xsl:apply-templates select="//bottom" mode="footnote"/>
</body>
</html>
</xsl:template>
<xsl:template match="bottom">
[<a href="#{generate-id()}"><xsl:number level="any"/></a>]
</xsl:template>
<xsl:template match="bottom" mode="footnote">
<p><a name="{generate-id()}">
[<xsl:number level="any"/>]
<xsl:value-of select="."/></a></p>
</xsl:template>
When the bottom element is processed on the first pass, it generates a link. When it is processed again on the second pass, it generates the text of the footnote, together with an anchor for the link.
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference