title: XSLT - How to keep only wanted elements from XML
body: <p>I have a number of XML files containing lots of overhead. I wish to keep only about 20 specific elements and filter out anything else. I know all the names of the elements I want to keep, I also know whether or not they are child elements and who are their parents. These elements that I want to keep after the transformation need to still have their original hierarchic placement.</p>
  
  <p>E.g. I want to keep ONLY </p>
  
  <blockquote>
    <p><code>&lt;ns:currency&gt;</code></p>
  </blockquote>
  
  <p>in;</p>
  
  <pre><code>&lt;ns:stuff&gt;
   &lt;ns:things&gt;
    &lt;ns:currency&gt;somecurrency&lt;/ns:currency&gt;
    &lt;ns:currency_code/&gt;
    &lt;ns:currency_code2/&gt;
    &lt;ns:currency_code3/&gt;
    &lt;ns:currency_code4/&gt;
   &lt;/ns:things&gt;
  &lt;/ns:stuff&gt;
  </code></pre>
  
  <p>And make it look like this;</p>
  
  <pre><code>&lt;ns:stuff&gt;
   &lt;ns:things&gt;
    &lt;ns:currency&gt;somecurrency&lt;/ns:currency&gt;
   &lt;/ns:things&gt;
  &lt;/ns:stuff&gt;
  </code></pre>
  
  <p>What would be the best way of constructing an XSLT to accomplish this?</p>