title: Can I get the parent nodes to copy with the child node using xslt?
body: <p>I am trying to include parent nodes of the node I am copying.</p>
  <p>Here is the sample file:</p>
  <pre><code>    &lt;A&gt;
         &lt;B&gt;
            &lt;C1&gt;Text Value&lt;/C1&gt; 
            &lt;C2&gt;&lt;/C2&gt;
            &lt;C3&gt;&lt;/C3&gt;
            &lt;C4&gt;&lt;/C4&gt;
        &lt;/B&gt;
     &lt;/A&gt;
  </code></pre>
  <p>I would like the output to be:</p>
  <pre><code> &lt;A&gt;
      &lt;B&gt;
         &lt;C1&gt;Text Value&lt;/C1&gt;
      &lt;/B&gt;
  &lt;/A&gt;
  </code></pre>
  <p>Here is my xslt:</p>
  <pre><code>&lt;xsl:stylesheet version=&quot;1.0&quot;
   xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt;
   &lt;xsl:output method=&quot;xml&quot; omit-xml-declaration=&quot;no&quot; indent=&quot;yes&quot;/&gt;
    
    
   &lt;xsl:template match=&quot;/A/B/C1&quot;&gt;
    &lt;xsl:copy&gt;
     &lt;xsl:apply-templates select=&quot;/A/B/C1&quot;/&gt;
    &lt;/xsl:copy&gt;
   &lt;/xsl:template&gt;
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  <p>However, my output does not show the parent nodes.</p>
  <p>Edit:
  C1 will always have the same Xpath.  I would also like to include the Text of the node.</p>