Try something more simple like this:
<xsl:template name="x">
<xsl:param name="count"/>
<xsl:if test="$count > 0">
<xsl:call-template name="x">
<xsl:with-param name="count" select="$count - 1"/>
</xsl:call-template>
</xsl:if>
[<xsl:value-of select="$count"/>]
</xsl:template>
<xsl:template match="/">
<xsl:call-template name="x">
<xsl:with-param name="count" select="3"/>
</xsl:call-template>
</xsl:template>
What should happen is this:
x is called with count = 3
x is called with count = 2
x is called with count = 1
x is called with count = 0
output [0]
output [1]
output [2]
output [3]
Does this make it any more clear? The values are output in reverse order because the template outputs the value after the recursive call returns.
If it's still not clear, imagine replacing template x by several templates x0, x1, x2, x3.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference