title: Python recursive XML parsing
body: <p>Brand new to XML parsing.  What would be the best way in python to parse something like:</p>
  
  <pre><code>&lt;Item name="item1"&gt;
      &lt;data&gt;item1data&lt;/data&gt;
      &lt;subItems&gt;
          &lt;Item name="item2"&gt;
              &lt;data&gt;item2data&lt;/data&gt;
              &lt;subItems&gt;
                  &lt;Item name="item3"&gt;
                    . . .
                  &lt;/Item&gt;
              &lt;/subItems&gt;
          &lt;/Item&gt;
          &lt;Item name="item4"&gt;
            . . .
          &lt;/Item&gt;
      &lt;subItems&gt;
  &lt;/Item&gt;
  </code></pre>
  
  <p>I was looking at <code>xml.sax</code> parsing, but couldn't figure out how to enable it to do multiple levels of parsing down the <code>subItems</code> trees.  Could someone give me a recommendation of a parser/method to parse this?  Thank you!</p>
  
  <p>I will be creating lists of 'Item' objects with this, expected results would loopks something like this:</p>
  
  <pre><code>[Item(item1, item1data, 
      [Item(item2, item2data, 
          [Item(item3 ... ]) Item(item4 ... )])]`
  </code></pre>