title: Simple dom traversing in Python using xml.etree.ElementTree
body: <p>E.g. consider parsing a <code>pom.xml</code> file:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;com.parent&lt;/groupId&gt;
          &lt;artifactId&gt;parent&lt;/artifactId&gt;
          &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
          &lt;relativePath&gt;../pom.xml&lt;/relativePath&gt;
      &lt;/parent&gt;
  
      &lt;modelVersion&gt;2.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.parent.somemodule&lt;/groupId&gt;
      &lt;artifactId&gt;some_module&lt;/artifactId&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;Some Module&lt;/name&gt;
      ...
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>import xml.etree.ElementTree as ET
  
  tree = ET.parse(pom)
  root = tree.getroot()
  
  groupId = root.find("groupId")
  artifactId = root.find("artifactId")
  </code></pre>
  
  <p>Both <code>groupId</code> and <code>artifactId</code> are <code>None</code>.  Why when they are the direct descendants of the root?  I tried to replace the <code>root</code> with <code>tree</code> (<code>groupId = tree.find("groupId")</code>) but that didn't change anything.</p>