title: How to parse an XML file with encoding declaration in Python?
body: <p>I have this XML file, called <code>xmltest.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="GBK"?&gt;
  &lt;productMeta&gt;
      &lt;bands&gt;1,2,3,4&lt;/bands&gt;
      &lt;imageName&gt;TestName.tif&lt;/imageName&gt;  
      &lt;browseName&gt;TestName.jpg&lt;/browseName&gt;
  &lt;/productMeta&gt;
  </code></pre>
  
  <p>And I have this Python dummy code:</p>
  
  <pre><code>import xml.etree.ElementTree as ET
  xmldoc = ET.parse('xmltest.xml')
  </code></pre>
  
  <p>But it raises a <code>ValueError</code>:</p>
  
  <blockquote>
    <p>ValueError: multi-byte encodings are not supported</p>
  </blockquote>
  
  <p>I understand this error, it raises because the encoding declaration in the first line of the XML file. The XML file is UTF-8 encoded but always have that declaration (I'm not the creator of the XML files to be analyzed). How can I avoid such encoding declaration when parsing an XML file such the former one?</p>