title: Challenge - Processing XML into T-SQL table structure?
body: <p>If you have this XML:</p>
  
  <pre><code>&lt;people&gt;
    &lt;person id="1"&gt;
      &lt;firstname&gt;John&lt;/firstname&gt;
      &lt;surname&gt;Doe&lt;/surname&gt;
    &lt;/person&gt;
    &lt;person id="2"&gt;
      &lt;firstname&gt;Mary&lt;/firstname&gt;
      &lt;surname&gt;Jane&lt;/surname&gt;
    &lt;/person&gt;
  &lt;/people&gt;
  </code></pre>
  
  <p>And you wanted this table:</p>
  
  <pre><code>id  firstname  surname
  --- ---------- ----------
  1   John       Doe
  2   Mary       Jane
  </code></pre>
  
  <p>How would you get it there, using T-SQLXML?</p>
  
  <p>And to throw a spanner into the mix: Lets say you know the depth of the <code>&lt;person&gt;</code>, <code>&lt;firstname&gt;</code> and <code>&lt;surname&gt;</code> elements, but you don't know what they're called!</p>
  
  <p>Feel free to flame if you think this is better posted to reddit :)</p>