title: Removing elements from an XML document, XSLT and JAXB
body: <p>This question is a follow up to my earlier question:
  <a href="https://stackoverflow.com/questions/5178255/creating-a-valid-xsd-that-is-open-using-all-and-any-elements">Creating a valid XSD that is open using &lt;all&gt; and &lt;any&gt; elements</a></p>
  
  <p>Given that I have a Java String containing an XML document of the following form:</p>
  
  <pre><code>&lt;TRADE&gt;
    &lt;TIME&gt;12:12&lt;/TIME&gt;
    &lt;MJELLO&gt;12345&lt;/MJELLO&gt;
    &lt;OPTIONAL&gt;12:12&lt;/OPTIONAL&gt;
    &lt;DATE&gt;25-10-2011&lt;/DATE&gt;
    &lt;HELLO&gt;hello should be ignored&lt;/HELLO&gt;
  &lt;/TRADE&gt;
  </code></pre>
  
  <p>How can I use XSLT or similar (in Java by using JAXB) to remove all elements not contained in a set of elements.
  In the above example I am only interested in (TIME, OPTIONAL, DATE), so I would like to transform it into:</p>
  
  <pre><code>&lt;TRADE&gt;
    &lt;TIME&gt;12:12&lt;/TIME&gt;
    &lt;OPTIONAL&gt;12:12&lt;/OPTIONAL&gt;
    &lt;DATE&gt;25-10-2011&lt;/DATE&gt;
  &lt;/TRADE&gt;
  </code></pre>
  
  <p>The order of the elements is not fixed.</p>