title: Retrieving elements that has a tag - XML in Python
body: <p>From the sample xml below  </p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
      &lt;data&gt;
          &lt;country&gt;
              &lt;name&gt;Liechtenstein&lt;/name&gt;
              &lt;rank&gt;1&lt;/rank&gt;
              &lt;year&gt;2008&lt;/year&gt;
              &lt;gdppc&gt;141100&lt;/gdppc&gt;
              &lt;neighbor name="Austria" direction="E"/&gt;
              &lt;neighbor name="Switzerland" direction="W"/&gt;
          &lt;/country&gt;
          &lt;country&gt;
              &lt;name&gt;Singapore&lt;/name&gt;
              &lt;rank&gt;4&lt;/rank&gt;
              &lt;year&gt;2011&lt;/year&gt;
              &lt;gdppc&gt;59900&lt;/gdppc&gt;
              &lt;neighbor name="Malaysia" direction="N"/&gt;
          &lt;/country&gt;
          &lt;country&gt;
              &lt;name&gt;Panama&lt;/name&gt;
              &lt;rank&gt;68&lt;/rank&gt;
              &lt;year&gt;2011&lt;/year&gt;
              &lt;gdppc&gt;13600&lt;/gdppc&gt;
              &lt;neighbor name="Costa Rica" direction="W"/&gt;
              &lt;neighbor name="Colombia" direction="E"/&gt;
          &lt;/country&gt;
      &lt;/data&gt;
  </code></pre>
  
  <p>Using Python ElementTree</p>
  
  <pre><code>import xml.etree.ElementTree as ET
  tree = ET.parse('test.xml')
  
  
  for elem in tree.iter(tag='name'):
      print (elem.tag)
  </code></pre>
  
  <p>displays three name elements. How can I retrive just one name element <code>&lt;name&gt;Panama&lt;/name&gt;</code> with a specfic text.</p>
  
  <p><code>for elem in tree.iter(tag="name='panama'"):</code> not working</p>