title: Get children elements of multiple instances of the same name tag using ElementTree
body: <p>I have an xml file looking like this:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;data&gt;
  &lt;boundary_conditions&gt;
    &lt;rot&gt;
      &lt;rot_instance&gt;
        &lt;name&gt;BC_1&lt;/name&gt;
        &lt;rpm&gt;200&lt;/rpm&gt;
        &lt;parts&gt;
          &lt;name&gt;rim_FL&lt;/name&gt;
          &lt;name&gt;tire_FL&lt;/name&gt;
          &lt;name&gt;disk_FL&lt;/name&gt;
          &lt;name&gt;center_FL&lt;/name&gt;
        &lt;/parts&gt;
      &lt;/rot_instance&gt;
      &lt;rot_instance&gt;
        &lt;name&gt;BC_2&lt;/name&gt;
        &lt;rpm&gt;100&lt;/rpm&gt;
        &lt;parts&gt;
          &lt;name&gt;tire_FR&lt;/name&gt;
          &lt;name&gt;disk_FR&lt;/name&gt;
        &lt;/parts&gt;
      &lt;/rot_instance&gt;
  &lt;/data&gt;
  </code></pre>
  <p>I actually know how to extract data corresponding to each instance. So I can do this for the names <code>tag</code> as follows:</p>
  <pre><code>import xml.etree.ElementTree as ET
  tree = ET.parse('file.xml')
  root = tree.getroot()
  names= tree.findall('.//boundary_conditions/rot/rot_instance/name')
  for val in names:
      print(val.text)
  </code></pre>
  <p>which gives me:</p>
  <pre><code>BC_1
  BC_2
  </code></pre>
  <p>But if I do the same thing for the parts tag:</p>
  <pre><code>names= tree.findall('.//boundary_conditions/rot/rot_instance/parts/name')
  for val in names:
      print(val.text)
  </code></pre>
  <p>It will give me:</p>
  <pre><code>rim_FL
  tire_FL
  disk_FL
  center_FL
  tire_FR
  disk_FR
  </code></pre>
  <p>Which combines all data corresponding to parts/name together. I want output that gives me the 'parts' sub-element for each instance as separate lists. So this is what I want to get:</p>
  <pre><code>instance_BC_1 = ['rim_FL', 'tire_FL', 'disk_FL', 'center_FL']
  instance_BC_2 = ['tire_FR', 'disk_FR']
  </code></pre>
  <p>Any help is appreciated,
  Thanks.</p>