title: Python: How can I use lxml objectify's iterchildren to get details of siblings which are in a different namespace
body: <p>This is my xml file.</p>
  
  <p><strong>get_subscribers_result.xml</strong></p>
  
  <pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;SOAP-ENV:Header/&gt;
      &lt;SOAP-ENV:Body&gt;
          &lt;ns3:GetSubscriberResponse xmlns:ns3="http://example.com/123/ss/subscribermgmt/v1_0" xmlns:ns2="http://example.com/123/ss/base/v1_0" xmlns:ns4="http://example.com/123/ss/xyz/v1_0" &gt;
              &lt;ns3:subscriber&gt;
                  &lt;ns2:created&gt;2015-10-20T16:02:58.831Z&lt;/ns2:created&gt;
                  &lt;ns2:createdBy&gt;admin&lt;/ns2:createdBy&gt;
                  &lt;ns2:lastModified&gt;2015-10-20T16:02:58.824Z&lt;/ns2:lastModified&gt;
                  &lt;ns2:lastModifiedBy&gt;super&lt;/ns2:lastModifiedBy&gt;
                  &lt;ns2:subscriberDetail&gt;
                      &lt;ns2:key&gt;address&lt;/ns2:key&gt;
                      &lt;ns2:value&gt;1st vivekanandar street&lt;/ns2:value&gt;
                  &lt;/ns2:subscriberDetail&gt;
                  &lt;ns2:subscriberDetail&gt;
                      &lt;ns2:key&gt;state&lt;/ns2:key&gt;
                      &lt;ns2:value&gt;Abu Dhabi&lt;/ns2:value&gt;
                  &lt;/ns2:subscriberDetail&gt;
              &lt;/ns3:subscriber&gt;
          &lt;/ns3:GetSubscriberResponse&gt;
      &lt;/SOAP-ENV:Body&gt;
  &lt;/SOAP-ENV:Envelope&gt;
  </code></pre>
  
  <p>Now, I have seen an example from <a href="http://davekuhlman.org/Objectify_files/weather_test.py" rel="nofollow">http://davekuhlman.org/Objectify_files/weather_test.py</a> where iterchildren is used.</p>
  
  <p>The code works if there are no namespaces. 
  This code below would have worked for the xml i have , provided i did not have namespaces in my xml.</p>
  
  <pre><code>    obj2 = lxml.objectify.parse("get_subscribers_result.xml")
      root = obj2.getroot()
  
      tag = '{http://example.com/123/ss/base/v1_0}subscriberDetail'
  
      for subscriberDetail in enumerate(root.subscriber.iterchildren(tag=tag)):
                     print subscriberDetail.key
                     print subscriberDetail.value
                     print "*********************************"
  </code></pre>
  
  <p>If i run this, i get </p>
  
  <pre><code>AttributeError: no such child: {http://schemas.xmlsoap.org/soap/envelope/}subscriber
  </code></pre>
  
  <p>That's because subscriber doesn't belong to the default namespace and it is correct ! </p>
  
  <p>I tried </p>
  
  <pre><code>    for subscriberDetail in enumerate(root.{http://example.com/123/ss/subscribermgmt/v1_0}subscriber.iterchildren(tag=tag)):
  </code></pre>
  
  <p>Any ideas how to make this work when namespaces are present ?</p>