Bah, just use clean, erm, XSLT.
<xsl:template name="blah">
<xsl:param name="x" select="2"/>
<xsl:param name="y" select="5"/>
<xsl:param name="swapped" select="0"/>
...
<xsl:choose>
<xsl:when test="$swapped = 0">
<!-- First we run this code. -->
<!-- And say we want to swap x and y! -->
<!-- Oh no, we can't change their values! Curse! Recurse!!-->
<xsl:call-template name="blah">
<xsl:with-param name="x" select="$y"/>
<xsl:with-param name="y" select="$x"/>
<xsl:with-param name="swapped" select="1"/>
</xsl:call-template>
</xsl:when>
<!-- In the spirit of XML, they picked the most verbose name
out of the choices 'else', 'default', and 'otherwise.' -->
<xsl:otherwise>
<!-- Now x and y are swapped! -->
...
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Reputation Points: 1133
Solved Threads: 171
Super Senior Demiposter
Offline 2,478 posts
since Jun 2005