title: Removing double tags from XML document
body: <p>I'm trying to transform a document where I have things like</p>
  
  <pre><code>&lt;tag1&gt;
     &lt;tag1&gt;
        &lt;tag2&gt;....&lt;/tag2&gt;
        &lt;tag3&gt;....&lt;/tag3&gt;
        &lt;tag4&gt;
           &lt;tag4&gt;
             &lt;tag5&gt;...&lt;/tag5&gt;
             .
             .
           &lt;/tag4&gt;
      &lt;/tag1&gt;
  &lt;/tag1&gt;
  </code></pre>
  
  <p>I'd like to remove the duplicate tag1 and tag4. I won't know the names of the tags before I open the xml file.</p>
  
  <hr/>
  
  <p><strong>Update</strong></p>
  
  <p>Right. I have </p>
  
  <pre><code>&lt;xsl:template match="body/body"&gt; 
      &lt;xsl:apply-templates select="@*|node()"/&gt; 
  &lt;/xsl:template&gt; 
  </code></pre>
  
  <p>Which was a test for removing... </p>
  
  <pre><code>&lt;body&gt; 
      &lt;body&gt; 
          ---more xml here-- 
      &lt;/body&gt; 
  &lt;/body&gt; 
  </code></pre>
  
  <p>And that worked just fine removing one of the body tags. What I need is a more generic match expression to allow me to catch and remove any double tags, because I won't know until run-time what the double tags will be.</p>
  
  <p>What should I write in my xsl stylesheet?</p>