title: How to get the child of child using Python's ElementTree
body: <p>I'm building a Python file that communicates with a PLC. When compiling, the PLC creates a XML file that delivers important information about the program. The XML looks more less like this:</p>
  
  <pre><code>&lt;visu&gt;
      &lt;time&gt;12:34&lt;/time&gt;
      &lt;name&gt;my_visu&lt;/name&gt;
      &lt;language&gt;english&lt;/language&gt;
      &lt;vars&gt;
          &lt;var name="input1"&gt;2&lt;/var&gt;
          &lt;var name="input2"&gt;45.6&lt;/var&gt;
          &lt;var name="input3"&gt;"hello"&lt;/var&gt;
      &lt;/vars&gt;
  &lt;/visu&gt;
  </code></pre>
  
  <p>The important part is found under child "vars". Using Python I want to make a file that when sending argument "input2" it will print "45.6".</p>
  
  <p>So far I can read all children of "visu", but don't know how to actually tell Python to search among "the child of child". Here's is what I got so far:</p>
  
  <pre><code>tree = ET.parse("file.xml")
  root = tree.getroot()
  for child in root:
      if child.tag == "vars":
          .......
          if ( "childchild".attrib.get("name") == "input2" ):
              print "childchild".text
  </code></pre>
  
  <p>Any ideas how I can complete the script? (or maybe a more efficient way of programming it?)</p>