title: Using XPath in ElementTree
body: <p>My XML file looks like the following:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2008-08-19"&gt;
    &lt;Items&gt;
      &lt;Item&gt;
        &lt;ItemAttributes&gt;
          &lt;ListPrice&gt;
            &lt;Amount&gt;2260&lt;/Amount&gt;
          &lt;/ListPrice&gt;
        &lt;/ItemAttributes&gt;
        &lt;Offers&gt;
          &lt;Offer&gt;
            &lt;OfferListing&gt;
              &lt;Price&gt;
                &lt;Amount&gt;1853&lt;/Amount&gt;
              &lt;/Price&gt;
            &lt;/OfferListing&gt;
          &lt;/Offer&gt;
        &lt;/Offers&gt;
      &lt;/Item&gt;
    &lt;/Items&gt;
  &lt;/ItemSearchResponse&gt;
  </code></pre>
  
  <p>All I want to do is extract the ListPrice.</p>
  
  <p>This is the code I am using:</p>
  
  <pre><code>&gt;&gt; from elementtree import ElementTree as ET
  &gt;&gt; fp = open("output.xml","r")
  &gt;&gt; element = ET.parse(fp).getroot()
  &gt;&gt; e = element.findall('ItemSearchResponse/Items/Item/ItemAttributes/ListPrice/Amount')
  &gt;&gt; for i in e:
  &gt;&gt;    print i.text
  &gt;&gt;
  &gt;&gt; e
  &gt;&gt;
  </code></pre>
  
  <p>Absolutely no output. I also tried</p>
  
  <pre><code>&gt;&gt; e = element.findall('Items/Item/ItemAttributes/ListPrice/Amount')
  </code></pre>
  
  <p>No difference.</p>
  
  <p>What am I doing wrong?</p>