title: Python - XML Parsing - Accessing values of different descendants of the same element
body: <p>I am trying to parse an Xml file using Python. My file has a structure similar to the below:</p>
  
  <pre><code>&lt;dataset&gt;
    &lt;dataTable id = 123&gt;
        &lt;name&gt; Name1 &lt;/name&gt;
        &lt;attributeList&gt;
            &lt;attribute id = 1&gt;
                 &lt;measurement&gt;
                    &lt;textDomain&gt;
                       &lt;definition&gt;User defined. &lt;/definition&gt;
                    &lt;/textDomain&gt;
                 &lt;/measurement&gt;
            &lt;/attribute&gt;
            &lt;attribute id = 2&gt;
                 &lt;measurement&gt;
                    &lt;dateTime&gt;
                       &lt;formatString&gt;MM-YYYY &lt;/formatString&gt;
                    &lt;/dateTime&gt;
                 &lt;/measurement&gt;
            &lt;/attribute&gt;
        &lt;/attributeList&gt;
  &lt;/dataTable&gt;
  &lt;dataTable id = 456&gt;
      &lt;name&gt; Name8 &lt;/name&gt;
      &lt;attributeList&gt;
          &lt;attribute id = 3&gt;
               &lt;measurement&gt;
                  &lt;unit&gt;
                     &lt;standardUnit&gt;degree&lt;/standardUnit&gt;
                  &lt;/unit&gt;
               &lt;/measurement&gt;
          &lt;/attribute&gt;
     &lt;/attributeList&gt;
   &lt;/dataTable&gt;
  &lt;/dataset&gt;
  </code></pre>
  
  <p>I want to extract the text ("User defined.", "MM-YYYY", "degree") inside the <code>&lt;measurement&gt;</code> tag. The <code>&lt;measurement&gt;</code> tag has different descendants for each <code>&lt;attribute&gt;</code>. How do I extract the text in this case?
  Thanks in advance!</p>