title: Parsing xml in python gives null values
body: <p>I'm programming in python and I'm trying to read the status of my Yamaha network stereo.  I get the following xml response</p>
  
  <pre><code>&lt;YAMAHA_AV rsp="GET" RC="0"&gt;
      &lt;System&gt;
          &lt;Power_Control&gt;
              &lt;Power&gt;On&lt;/Power&gt;
          &lt;/Power_Control&gt;
      &lt;/System&gt;
  &lt;/YAMAHA_AV&gt;
  </code></pre>
  
  <p>All good so far.  Now, I'm trying to search for Power to get the latest status.  It is there in XML but I can't locate the Power Status value when I use a XML parser such as Elementtree.  </p>
  
  <pre><code>import requests
  from xml.etree import ElementTree as ET
  
  url = "http://192.168.128.199/YamahaRemoteControl/ctrl"
  
  payload = "&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;YAMAHA_AV cmd=\"GET\"&gt;\r\n&lt;System&gt;\r\n    &lt;Power_Control&gt;\r\n        &lt;Power&gt;GetParam&lt;/Power&gt;\r\n    &lt;/Power_Control&gt;\r\n&lt;/System&gt;\r\n&lt;/YAMAHA_AV&gt;"
  headers = {
      'Content-Type': "text/xml",
      'Cache-Control': "no-cache",
      'Postman-Token': "9ad57fc1-4c78-a921-5967-bef4d2167214"
      }
  
  response = requests.request("POST", url, data=payload, headers=headers)
  print(response.text)
  rawdata=ET.fromstring(response.content)
  result= rawdata.find('Power').text
  print (result)
  result = rawdata.items()
  print(result)
  </code></pre>
  
  <p>I get a null value.  So I step through python interactive and I can see findall and findtext attribute when I use dir() function on the root but not on the subelements. </p>
  
  <pre><code>&gt;&gt;&gt; root=ET.parse('yamahaPowerStatus.xml').getroot()
  &gt;&gt;&gt; print root
  &lt;Element 'YAMAHA_AV' at 0x6386bb0&gt;
  &gt;&gt;&gt; PC=root.getchildren()[0].getchildren()
  &gt;&gt;&gt; print PC
  [&lt;Element 'Power_Control' at 0x6386cf0&gt;]
  &gt;&gt;&gt; check= PC.findtext('Power')
  
  Traceback (most recent call last):
    File "&lt;pyshell#40&gt;", line 1, in &lt;module&gt;
      check= PC.findtext('Power')
  AttributeError: 'list' object has no attribute 'findtext'
  </code></pre>
  
  <blockquote>
    <blockquote>
      <blockquote>
        <p>dir(PC)
            ['<strong>add</strong>', '<strong>class</strong>', '<strong>contains</strong>', '<strong>delattr</strong>', '<strong>delitem</strong>', '<strong>delslice</strong>', '<strong>doc</strong>', '<strong>eq</strong>', '<strong>format</strong>', '<strong>ge</strong>', '<strong>getattribute</strong>', '<strong>getitem</strong>', '<strong>getslice</strong>', '<strong>gt</strong>', '<strong>hash</strong>', '<strong>iadd</strong>', '<strong>imul</strong>', '<strong>init</strong>', '<strong>iter</strong>', '<strong>le</strong>', '<strong>len</strong>', '<strong>lt</strong>', '<strong>mul</strong>', '<strong>ne</strong>', '<strong>new</strong>', '<strong>reduce</strong>', '<strong>reduce_ex</strong>', '<strong>repr</strong>', '<strong>reversed</strong>', '<strong>rmul</strong>', '<strong>setattr</strong>', '<strong>setitem</strong>', '<strong>setslice</strong>', '<strong>sizeof</strong>', '<strong>str</strong>', '<strong>subclasshook</strong>', 'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', 'sort']</p>
        
        <p>dir (root)
        ['<strong>class</strong>', '<strong>delattr</strong>', '<strong>delitem</strong>', '<strong>dict</strong>', '<strong>doc</strong>', '<strong>format</strong>', '<strong>getattribute</strong>', '<strong>getitem</strong>', '<strong>hash</strong>', '<strong>init</strong>', '<strong>len</strong>', '<strong>module</strong>', '<strong>new</strong>', '<strong>nonzero</strong>', '<strong>reduce</strong>', '<strong>reduce_ex</strong>', '<strong>repr</strong>', '<strong>setattr</strong>', '<strong>setitem</strong>', '<strong>sizeof</strong>', '<strong>str</strong>', '<strong>subclasshook</strong>', '<strong>weakref</strong>', '_children', 'append', 'attrib', 'clear', 'copy', 'extend', 'find', 'findall', 'findtext', 'get', 'getchildren', 'getiterator', 'insert', 'items', 'iter', 'iterfind', 'itertext', 'keys', 'makeelement', 'remove', 'set', 'tag', 'tail', 'text']</p>
      </blockquote>
    </blockquote>
  </blockquote>
  
  <p>So what am I'm doing wrong?  The XML response appears to be properly formatted.  I tried using other XML parsers but the same result.  I also tried converting it to JSON first but the same result.  I reviewed youtube videos and I tried to locate something similar here with no luck. I think I'm doing something fundamentally wrong.  </p>