> Sorry, how do you do this with the saxon extensions?
Do you mean with Saxon 6.5.x, which implements XSLT 1.0? (I'm not sure why anyone would be using that in preference to Saxon 9.0, unless you've got some strange constraint like being tied to Java 1.1!)
Like most XSLT 1.0 processors Saxon 6.5.x has a saxon:node-set() extension, which allows you to do
<xsl:variable name="temp">
<a><xsl:value-of select="$var1"/></a>
<a><xsl:value-of select="$var2"/></a>
</xsl:variable>
<xsl:for-each select="saxon:node-set($temp)/a">
<xsl:sort select="."/>
....
Or in fact you don't need the saxon:node-set($temp), you can just write select="$temp", provided you say version="1.1" on the xsl:stylesheet element.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference