title: Check if XML Element has children or not, in ElementTree
body: <p>I retrieve an XML documents this way:</p>
  
  <pre><code>import xml.etree.ElementTree as ET
  
  root = ET.parse(urllib2.urlopen(url))
  for child in root.findall("item"):
    a1 = child[0].text # ok
    a2 = child[1].text # ok
    a3 = child[2].text # ok
    a4 = child[3].text # BOOM
    # ...
  </code></pre>
  
  <p>The XML looks like this:</p>
  
  <pre><code>&lt;item&gt;
    &lt;a1&gt;value1&lt;/a1&gt;
    &lt;a2&gt;value2&lt;/a2&gt;
    &lt;a3&gt;value3&lt;/a3&gt;
    &lt;a4&gt;
      &lt;a11&gt;value222&lt;/a11&gt;
      &lt;a22&gt;value22&lt;/a22&gt;
    &lt;/a4&gt;
  &lt;/item&gt;
  </code></pre>
  
  <p>How do I check if <code>a4</code> (in this particular case, but it might've been any other element) has children? </p>