title: Easier way to extract only prefixed elements from mixed xml/html
body: <p>This is my working nightmare: we have a bunch of files that are html pages but which contain additional xml elements (all prefixed with our company name 'TLA') to provide data and structure for an older program which I am now rewriting.</p>
  
  <p>Example Form:</p>
  
  <pre><code>&lt;html &gt;
  &lt;head&gt;
      &lt;title&gt;Highly Simplified Example Form&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;TLA:document&gt;
          &lt;TLA:contexts&gt;
              &lt;TLA:context id="id_1" value=""&gt;&lt;/TLA:context&gt;
          &lt;/TLA:contexts&gt;
          &lt;TLA:page&gt;
              &lt;TLA:question id="q_id_1"&gt;
                  &lt;table&gt;
                      &lt;tr&gt;
                          &lt;td&gt;
                              &lt;input id="input_id_1" type="text" /&gt;
                          &lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;
              &lt;/TLA:question&gt;
          &lt;/TLA:page&gt;
          &lt;!-- Repeat many times --&gt;
      &lt;/TLA:document&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My task is to write a pre-processor that will split a document like this into two documents: an xml file containing only the 'TLA' elements and an html file containing only the html elements.</p>
  
  <p>Example XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;TLA:document&gt;
      &lt;TLA:contexts&gt;
        &lt;TLA:context id="id_1" value=""&gt;&lt;/TLA:context&gt;
      &lt;/TLA:contexts&gt;
      &lt;TLA:page&gt;
        &lt;TLA:question  id="q_id_1"&gt;
        &lt;/TLA:question&gt;
      &lt;/TLA:page&gt;
      &lt;!-- Repeat many times --&gt;
  &lt;/TLA:document&gt;
  </code></pre>
  
  <p>Example HTML:</p>
  
  <pre><code>&lt;html &gt;
  &lt;head&gt;
      &lt;title&gt;Highly Simplified Example Form&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;table&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;input id="input_id_1" type="text" /&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
      &lt;!-- Repeat many times --&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now I can do this by processing each element one at a time and copying them to new documents but I'm thinking that there might be an easier way to do this by using a one or two pass transform or some clever serialization but I have no idea which avenues to explore.</p>
  
  <p>So does anyone have a suggestion as to how to process this? Ideally VB.net but C# or something else is also acceptable.</p>
  
  <p>Update:</p>
  
  <p>It seems that xslt is the way to do this but I know so little about it that I still need some help. It seems that  //namespace::TLA may be the right xpath to extract the data elements but I have no idea how to implement it.</p>