title: Use an element twice in XSLT
body: <p>I have an XML data file that contains the data already grouped and ordered. I just need to bring it in and massage it a bit.</p>
  
  <p>So, I created the XSLT to bring in the content in the order I need it, but I'd like to use a data element twice, but xsl:copy-of doesn't work. It's probably something really simple but I can't figure it out.</p>
  
  <p>Here is a simplified version of the XSLT:</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
      &lt;xsl:strip-space elements="*" /&gt;
      &lt;xsl:output method="xml" /&gt;
      &lt;xsl:template match="/"&gt;
          &lt;dataroot&gt;
              &lt;xsl:apply-templates select="dataroot" /&gt;
          &lt;/dataroot&gt;
      &lt;/xsl:template&gt;
      &lt;xsl:template match="CaseStudies"&gt;
          &lt;xsl:text&gt;&lt;/xsl:text&gt;
          &lt;CaseStudies&gt;
              &lt;xsl:apply-templates select="H1" /&gt;
              &lt;xsl:text&gt;&lt;/xsl:text&gt;
              &lt;xsl:apply-templates select="code" /&gt;
              &lt;xsl:apply-templates select="tip" /&gt;
          &lt;/CaseStudies&gt;
      &lt;/xsl:template&gt;
      &lt;xsl:template match="code"&gt;
          &lt;code&gt;
              &lt;xsl:value-of select="." /&gt;
          &lt;/code&gt;
      &lt;/xsl:template&gt;
      &lt;xsl:template match="tip[string-length() != 0]"&gt;
          &lt;xsl:text&gt;&lt;/xsl:text&gt;
          &lt;Head&gt;Coding Tip for &lt;xsl:copy-of select="code" /&gt;&lt;/Head&gt;
          &lt;xsl:text&gt;&lt;/xsl:text&gt;
          &lt;tip&gt;
              &lt;xsl:value-of select="." /&gt;
          &lt;/tip&gt;
      &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Here is some sample XML:</p>
  
  <pre><code>&lt;dataroot&gt;
      &lt;CaseStudies&gt;
          &lt;H1&gt;Heading&lt;/H1&gt;
          &lt;code&gt;90034&lt;/code&gt;
          &lt;tip&gt;Here is the tip text&lt;/tip&gt;
      &lt;/CaseStudies&gt;
      &lt;CaseStudies&gt;
          &lt;H1&gt;Heading&lt;/H1&gt;
          &lt;code&gt;90501&lt;/code&gt;
          &lt;tip&gt;Here is the tip text&lt;/tip&gt;
      &lt;/CaseStudies&gt;
      &lt;CaseStudies&gt;
          &lt;H1&gt;Heading&lt;/H1&gt;
          &lt;code&gt;90601&lt;/code&gt;
          &lt;tip&gt;Here is the tip text&lt;/tip&gt;
      &lt;/CaseStudies&gt;
  &lt;/dataroot&gt;
  </code></pre>