title: parsing XML file gets UnicodeEncodeError (ElementTree) / ValueError (lxml)
body: <p>I send a GET request to the <a href="http://api.careerbuilder.com/">CareerBuilder API</a> :</p>
  
  <pre><code>import requests
  
  url = "http://api.careerbuilder.com/v1/jobsearch"
  payload = {'DeveloperKey': 'MY_DEVLOPER_KEY',
             'JobTitle': 'Biologist'}
  r = requests.get(url, params=payload)
  xml = r.text
  </code></pre>
  
  <p>And get back an XML that looks like <a href="http://pastebin.com/jwXdYhMf">this</a>. However, I have trouble parsing it.</p>
  
  <p>Using either <code>lxml</code></p>
  
  <pre><code>&gt;&gt;&gt; from lxml import etree
  &gt;&gt;&gt; print etree.fromstring(xml)
  
  Traceback (most recent call last):
    File "&lt;pyshell#4&gt;", line 1, in &lt;module&gt;
      print etree.fromstring(xml)
    File "lxml.etree.pyx", line 2992, in lxml.etree.fromstring (src\lxml\lxml.etree.c:62311)
    File "parser.pxi", line 1585, in lxml.etree._parseMemoryDocument (src\lxml\lxml.etree.c:91625)
  ValueError: Unicode strings with encoding declaration are not supported.
  </code></pre>
  
  <p>or <code>ElementTree:</code></p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;pyshell#3&gt;", line 1, in &lt;module&gt;
      print ET.fromstring(xml)
    File "C:\Python27\lib\xml\etree\ElementTree.py", line 1301, in XML
      parser.feed(text)
    File "C:\Python27\lib\xml\etree\ElementTree.py", line 1641, in feed
      self._parser.Parse(data, 0)
  UnicodeEncodeError: 'ascii' codec can't encode character u'\xa0' in position 3717: ordinal not in range(128)
  </code></pre>
  
  <p>So, even though the XML file starts with</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p>I have the impression that it contains characters that are not allowed. How do I parse this file with either <code>lxml</code>or <code>ElementTree</code>?</p>