title: how to iterate through root element in ElementTree with xml namespace
body: <p>I am trying to iterate over my xml file. The root element contains xml name spaces, that prevent me to iterate over ClsItems tags.
  <strong>My XML:</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  
  &lt;ArrayOfClsItems xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns=&quot;http://ws.comax.co.il/Comax_WebServices/&quot;&gt;
  
      &lt;ClsItems&gt;
  
          &lt;Name&gt;Item 0&lt;/Name&gt;
  
          &lt;Size /&gt;
  
          &lt;ID&gt;1&lt;/ID&gt;
  
      &lt;/ClsItems&gt;
      
      &lt;ClsItems&gt;
  
          &lt;Name&gt;Item 1&lt;/Name&gt;
  
          &lt;Size /&gt;
  
          &lt;ID&gt;1&lt;/ID&gt;
      
      &lt;/ClsItems&gt;
      ...
  
  &lt;/ArrayOfClsItems&gt;
  
  </code></pre>
  <p><strong>My parsing iteration attempt:</strong></p>
  <pre><code>import xml.etree.ElementTree as ET
  tree = ET.parse(xml_path)
  root = tree.getroot()
  headers = []
  product_dict = { &quot;Name&quot;: [], &quot;Size&quot;: [], 'Id': []}
  
  for idx, item in enumerate(root.findall('.//ClsItems')):
     if idx == 0:
          headers = [x.tag for x in list(item)]
     for h in headers:
          if h in product_dict:
               product_dict[h].append(item.find(h).text)
  
  </code></pre>
  <p>When I tried to delete the xml name spaces:</p>
  <pre><code>xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; 
  xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; 
  xmlns=&quot;http://ws.comax.co.il/Comax_WebServices/&quot; 
  </code></pre>
  <p>The code worked perfectly.</p>
  <p>Any ideas on how to define the root so I can iterate with the namespaces?</p>