 <p>Another version w/o building lists. import xml.etree.ElementTree as ET</p> <pre><code>PATH_IN = "sweep.xml" tree = ET.parse(PATH_IN) def convert(root): for p in root.iter('project'): yield p.get('name') for d in p.iter('design'): yield d.get('name') for e in d.iter('param'): yield [e.attrib['name'], [p.text for p in e]] it = convert(tree.getroot()) import pprint pprint.pprint(list(it)) </code></pre> <p>On OP input gives.</p> <pre><code>['testProj', 'des1', ['mag_d', ['3mm', '1', '5', '1']], ['mag_x', ['3mm', '2', '7', '1']], ['mag_y', ['3mm', '1', '2', '0.1']], 'des2', ['mag_d', ['3mm', '1', '5', '1']], ['mag_x', ['3mm', '2', '7', '1']], ['mag_y', ['3mm', '1', '2', '0.1']]] </code></pre>