 <p>Whenever you declare a variable in XSLT 1.0 without @select, but with some content template, the variable type will be of Result Tree Fragment. The variable holds the root node of this tree fragment.</p> <p>So, with this:</p> <pre><code>&lt;xsl:variable name="source"&gt; &lt;xsl:copy-of select="$currentPage" /&gt; &lt;/xsl:variable&gt; </code></pre> <p>You are declaring <code>$source</code> as the root of a RTF containing the <strong>copy</strong> of the nodes (self and descendants) in <code>$currentPage</code> node set.</p> <p>You can't use <code>/</code> step operator with RTF. That's why you are ussing <code>node-set</code> extension function.</p> <p><strong>But</strong>, when you say:</p> <pre><code>node-set($source)/ancestor-or-self::* </code></pre> <p>This will be evaluate to an empty node set, because a root node hasn't ancestors an it's not an element. </p> <p><strong>EDIT</strong>: If you have two node sets, and you want to declare a variable with the content of one of the two node sets depending on some condition, you could use:</p> <pre><code>&lt;xsl:variable name="current" select="umbraco.library:GetXmlNodeById($source)[$source &gt; 0] |$currentPage[0 &gt;= $source]" /&gt; </code></pre>