title: Applying all templates to a global variable instead of source
body: <p>I have used a global variable to capture a set of nodes from the source XML. For each node in the source XML I need to check if that node exists in the variable. Is this possible?</p>
  
  <p>The other option is to have all the templates apply to the global variable instead of the source XML. But I don't know if that is possible either.</p>
  
  <p>Given the answer below. If I try to apply the templates to the global variable I get the following code, but it doesn't work. How do I pass the variable on to the rest of the templates and still have the appropriate matches?</p>
  
  <pre><code>&lt;xsl:variable name="transformation_result"&gt;   
    &lt;ABC&gt;
      &lt;xsl:copy-of select="/ABC/Data"/&gt;
    &lt;/ADT&gt;
  &lt;/xsl:variable&gt;
  
    &lt;xsl:template match="/"&gt;
      &lt;xsl:apply-templates select="$transformation_result"/&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template match="node()"&gt;
      &lt;xsl:copy&gt;
        &lt;xsl:apply-templates select="node()"/&gt;
      &lt;/xsl:copy&gt;
    &lt;/xsl:template&gt;
  
    &lt;xsl:template name="remove_whitespace" match="text()"&gt;
      &lt;xsl:value-of select="normalize-space()"/&gt;
    &lt;/xsl:template&gt;
  </code></pre>