title: Parsing XML using python using xmldom or etree
body: <p>I have an XML in the below format:</p>
  
  <pre><code>&lt;root&gt;
      &lt;child&gt;
          &lt;param1&gt; 1 &lt;/param1&gt;
          &lt;param2&gt; 2 &lt;/param2&gt;
      &lt;/child&gt;
  
      &lt;other_child&gt;
          &lt;grand_child&gt;
              &lt;param&gt;a&lt;/param&gt;
              &lt;param&gt;b&lt;/param&gt;
          &lt;/grand_child&gt;
          &lt;grand_child2&gt;
              &lt;param&gt;c&lt;/param&gt;
              &lt;param&gt;d&lt;/param&gt;
          &lt;/grand_child2&gt;
      &lt;/other_child&gt;
  &lt;/root&gt;
  </code></pre>
  
  <p>I have been using the below code snippets to parse it.</p>
  
  <pre><code>root = eTree.parse(configFile).getroot()
  
  for child in root:
      for g_child in child:
          print(g_child.tag, g_child.attrib)
  </code></pre>
  
  <p>This is the output I get:</p>
  
  <pre><code>param1 {}
  param2 {}
  grand_child {}
  grand_child2 {}
  </code></pre>
  
  <p>I also tried <code>minidom</code> and it gives me similar results.</p>
  
  <p>Thanks in advance.</p>