<xsl:template match="*" name="fun"> <xsl:param name="x"/> <xsl:choose> <xsl:when test="0<$x"> <S> <xsl:call-template name="fun"> <xsl:with-param name="x" select="$x -1"/> </xsl:call-template> </S> </xsl:when> <xsl:otherwise> <Z/> </xsl:otherwise> </xsl:choose> </xsl:template>