title: XSLT : Copy whole xml document discarding specific parent nodes
body: <p>I have something like this : </p>
  
  <pre><code>&lt;body&gt;
      foo bar foo bar foo bar...
      &lt;p&gt;foo bar!&lt;/p&gt;
      &lt;div class="iWantYourContent"&gt;
          &lt;p&gt;baz&lt;/p&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I want this output:</p>
  
  <pre><code>&lt;body&gt;
      foo bar foo bar foo bar...
      &lt;p&gt;foo bar!&lt;/p&gt;
      &lt;p&gt;baz&lt;/p&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>I have managed to get the content of the node using this :</p>
  
  <pre><code>&lt;xsl:template match="/"&gt;
          &lt;xsl:apply-templates select="//x:div[@class = 'iWantYourContent']"/&gt;
  &lt;/xsl:template&gt;
  
  &lt;xsl:template match="//x:div[@class = 'iWantYourContent']"&gt;
      &lt;body&gt;
          &lt;xsl:copy-of select="node()"/&gt;
      &lt;/body&gt;
  &lt;/xsl:template&gt;
  </code></pre>
  
  <p>But i'm not able to keep the rest of the document.</p>
  
  <p>Thanks for helping.</p>