You can let XSLT count occurrences of elements.
This lets you do things like hierarchical numbering.
An example:
<xsl:template match="section/title"> <title>Section <xsl:number count="section" level="multiple" format="1.1. "/> <xsl:apply-templates/> </title> </xsl:template>x
Full Example: number.xsl sections.xml
Read chapter 9 in Learning XSLT for more information.