title: Use XSL to generate dynamic XSL that is executed within the same script?
body: <p>I want to dynamically create variables with dynamic names for later use in my transform, but to do this I'd need to dynamically generate XSL and then run it in the same script.</p>
  
  <p>This is just a rough pseudo code example of what I'm looking for.</p>
  
  <pre><code>      &lt;xsl:for-each select="//constants/constant" &gt;
          &lt;xsl:variable &gt;
              &lt;xsl:attribute name="name"&gt;
                &lt;xsl:value-of select="@name"/&gt;
              &lt;/xsl:attribute&gt;
            &lt;xsl:attribute name="select"&gt;
              &lt;xsl:value-of select="@value"/&gt;
            &lt;/xsl:attribute&gt;
          &lt;/xsl:variable&gt;
        &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>Can I use XSL to dynamically build XSL to be run later in the same script?</p>
  
  <p>Note: our XML is transformed via a batch process running a CL XSL transform engine; so just referencing an XSL stylesheet in the XSL document isn't an option.</p>