title: Python XML ElementTree - findall
body: <p>I'm working with XML files.
  My file is like that :</p>
  
  <pre><code>import xml.etree.ElementTree as ET
  
  xml = '''
  &lt;root&gt;
      &lt;query label="nom1" code="1234"&gt;
          &lt;where a="1" b="2"&gt;
              &lt;condition id="1534" expr="expression1"/&gt;
          &lt;/where&gt;
      &lt;/query&gt;
      &lt;query label="nom2" code="2345"&gt;
          &lt;where a="2" b="3"&gt;
              &lt;condition id="6784" expr="expression2"/&gt;
          &lt;/where&gt;
      &lt;/query&gt;
  &lt;/root&gt;
  '''
  
  myroot = ET.fromstring(xml)
  </code></pre>
  
  <p>I want to have the label and the expr for each query.
  For example, it will print me :</p>
  
  <pre><code>query 1 :
      nom1
      expression1
  query 2:
      nom2
      expression2
  </code></pre>
  
  <p>Do you know how can I do that ?
  I know how to print all the label:</p>
  
  <pre><code>for type_tag in myroot.findall('root/query'):
      print(type_tag.attrib['label'])
  </code></pre>
  
  <p>And how to print all the expr:</p>
  
  <pre><code>for e in myroot.findall("root/query/.//*[@expr]"):
          print(e.attrib['expr'])
  </code></pre>
  
  <p>But I don't know how to do for both in the same time.</p>
  
  <p>Any comment will be helpful !</p>
  
  <p>Have a nice day :)</p>