title: Importing several XML files (with the same elements) into combined MySQL tables
body: <p>I have several XML files, all of the format:</p>
  
  <pre><code> &lt;story id="12349"&gt;
     &lt;name&gt;Reviews&lt;/name&gt;
     &lt;slug&gt;reviews&lt;/slug&gt;
     &lt;categories&gt;
       &lt;category primary="1"&gt;cat1&lt;/category&gt;
       &lt;category&gt;cat2&lt;/category&gt;
     &lt;/categories&gt;
   &lt;/story&gt;
  </code></pre>
  
  <p>How can I import them all into a MySQL database (ideally using PHP, as this is what I know best) which will let me edit the <code>&lt;category&gt;</code> elements? I'm imagining I want one table with a field for the id and a field for the complete XML, and another with a field for the id and fields for each of the <code>&lt;category&gt;</code> elements, though am open to any other suggestions.</p>
  
  <p>Many thanks...</p>