title: Get Values from child nodes from XML | Python
body: <p>I have the following XML. </p>
  
  <p>I am using ElementTree library to scrape the values.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&gt;
   &lt;url&gt;    
    &lt;loc&gt; Test1&lt;/loc&gt;
    &lt;/url&gt;
   &lt;url&gt;
    &lt;loc&gt;Test 2&lt;/loc&gt;
   &lt;/url&gt;
   &lt;url&gt;
    &lt;loc&gt;Test 3&lt;/loc&gt;
   &lt;/url&gt;
  &lt;/urlset&gt;
  </code></pre>
  
  <p>I need to get the values out of 'loc tag'. </p>
  
  <p>Desired Output: </p>
  
  <pre><code>Test 1
  Test 2
  Test 3
  </code></pre>
  
  <p>Tried Code: </p>
  
  <pre><code>tree = ET.parse('sitemap.xml')
  root = tree.getroot()
  for atype in root.findall('url'):
   rank = atype.find('loc').text
  print (rank)
  </code></pre>
  
  <p>Any suggestions on where am I wrong ?</p>