title: xsl:value-of used as xsl:element name
body: <p>I have an incoming XML file with a list structure:</p>
  
  <pre><code>&lt;list&gt;
    &lt;listItem&gt;
      &lt;name&gt;elementOne&lt;/name&gt;
      &lt;value&gt;elementOneValue&lt;/name&gt;
    &lt;/listItem&gt;
    &lt;listItem&gt;
      &lt;name&gt;elementTwo&lt;/name&gt;
      &lt;value&gt;elementTwoValue&lt;/name&gt;
    &lt;/listItem&gt;
  &lt;/list&gt;
  </code></pre>
  
  <p>Which I am trying to convert to this structure:</p>
  
  <pre><code>&lt;elementOne&gt;elementOneValue&lt;/elementOne&gt;
  &lt;elementTwo&gt;elementTwoValue&lt;/elementTwo&gt;
  </code></pre>
  
  <p>This is easy logic to implement with XSL, but I'm running into complications.</p>
  
  <pre><code>&lt;xsl:for-each select="/list/listItem"&gt;
    &lt;xsl:element name="&lt;xsl:value-of select="name"/&gt;"&gt;
      &lt;xsl:value-of select="value"/&gt;
    &lt;/xsl:element&gt;
  &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>Doesn't work because I assume the sequential double quotes are breaking the <code>&lt;xsl:element&gt;</code> tag</p>
  
  <pre><code>&lt;xsl:for-each select="/list/listItem"&gt;
    &lt;&lt;xsl:value-of select="name"/&gt;&gt;
      &lt;xsl:value-of select="value"/&gt;
    &lt;/&lt;xsl:value-of select="name"/&gt;&gt;
  &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>Doesn't work because I can't use <code>&lt;&lt;</code> or <code>&gt;&gt;</code> and</p>
  
  <pre><code>&lt;xsl:for-each select="/list/listItem"&gt;
    &amp;lt;&lt;xsl:value-of select="name"/&gt;&amp;gt;
      &lt;xsl:value-of select="value"/&gt;
    &amp;lt;/&lt;xsl:value-of select="name"/&gt;&amp;gt;
  &lt;/xsl:for-each&gt;
  </code></pre>
  
  <p>Doesn't work because I end up with &gt; and &lt; in my code instead of XML parseable <code>&lt;</code> or <code>&gt;</code>.  I expected this to be a very easy solution but I can't find any records for it on the internet.  What is the simple fix I'm overlooking?</p>