I tried your stylesheet (running on itself) with saxon 8.4, it falls
foul of compile time checking. XSLt2 allows the system to report
certain errors even in code that will never be executed.
(Don't blame me

this severely compromises the use of function-available in an xsl:choose
as a guard for conditional code as the compiler barfs on the branches
that will not be executed. A compile time xsl:use-when facility has been
added to try to restore some usability, I have added this to your code
below and Ithink it should work now in msxml saxon6 and saxon8 (although
I only ran it with saxon 8.4)
David
<xsl:stylesheet version="2.0"
xmlns

sl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com

slt"
xmlns:saxon="http://icl.com/saxon"
>
<xsl

utput method="xml" encoding="UTF-8" />
<xsl:variable name="gMyNodes">
<MyNodes>
<a/>
<b/>
</MyNodes>
</xsl:variable>
<xsl:template match="/">
<NodeTest>
<xsl:variable name="vMyNodeSet">
<xsl:choose>
<xsl:when test="function-available('msxsl:node-set')">
<msxml>
<xsl:copy-of use-when="function-available('msxsl:node-set')" select="msxsl:node-set($gMyNodes)"/><!-- saxon
error -->
</msxml>
</xsl:when>
<xsl:when test="function-available('saxon:node-set')">
<saxon>
<xsl:copy-of use-when="function-available('saxon:node-set')" select="saxon:node-set($gMyNodes)"/><!-- saxon
error -->
</saxon>
</xsl:when>
<xsl:when test="system-property('xsl:version')='2.0'">
<saxon8>
<xsl:sequence select="$gMyNodes"/>
</saxon8>
</xsl:when>
<xsl

therwise>
<ERROR>No node set function available, or missing
processor</ERROR>
</xsl

therwise>
</xsl:choose>
</xsl:variable>
<xsl:copy-of select="$vMyNodeSet"/>
</NodeTest>
</xsl:template>
</xsl:stylesheet>