title: How to parse xml from local file or url with lxml?
body: <p>I try to use lxml to parse xml, but I have a problem:</p>
  <pre><code>ValueError: invalid \x escape
  </code></pre>
  <p>Here is my code:</p>
  <pre><code>from lxml import etree
  root=etree.fromstring('C:\Users\hptphuong\Desktop\xmltest.xml')
  </code></pre>
  <p>I'm a newbie on lxml. Please help me to fix this issue.
  There is my xml content</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot;?&gt;
  &lt;catalog&gt;
     &lt;book id=&quot;bk101&quot;&gt;
        &lt;author&gt;Gambardella, Matthew&lt;/author&gt;
        &lt;title&gt;XML Developer's Guide&lt;/title&gt;
        &lt;genre&gt;Computer&lt;/genre&gt;
        &lt;price&gt;44.95&lt;/price&gt;
        &lt;publish_date&gt;2000-10-01&lt;/publish_date&gt;
        &lt;description&gt;An in-depth look at creating applications 
        with XML.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk102&quot;&gt;
        &lt;author&gt;Ralls, Kim&lt;/author&gt;
        &lt;title&gt;Midnight Rain&lt;/title&gt;
        &lt;genre&gt;Fantasy&lt;/genre&gt;
        &lt;price&gt;5.95&lt;/price&gt;
        &lt;publish_date&gt;2000-12-16&lt;/publish_date&gt;
        &lt;description&gt;A former architect battles corporate zombies, 
        an evil sorceress, and her own childhood to become queen 
        of the world.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk103&quot;&gt;
        &lt;author&gt;Corets, Eva&lt;/author&gt;
        &lt;title&gt;Maeve Ascendant&lt;/title&gt;
        &lt;genre&gt;Fantasy&lt;/genre&gt;
        &lt;price&gt;5.95&lt;/price&gt;
        &lt;publish_date&gt;2000-11-17&lt;/publish_date&gt;
        &lt;description&gt;After the collapse of a nanotechnology 
        society in England, the young survivors lay the 
        foundation for a new society.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk104&quot;&gt;
        &lt;author&gt;Corets, Eva&lt;/author&gt;
        &lt;title&gt;Oberon's Legacy&lt;/title&gt;
        &lt;genre&gt;Fantasy&lt;/genre&gt;
        &lt;price&gt;5.95&lt;/price&gt;
        &lt;publish_date&gt;2001-03-10&lt;/publish_date&gt;
        &lt;description&gt;In post-apocalypse England, the mysterious 
        agent known only as Oberon helps to create a new life 
        for the inhabitants of London. Sequel to Maeve 
        Ascendant.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk105&quot;&gt;
        &lt;author&gt;Corets, Eva&lt;/author&gt;
        &lt;title&gt;The Sundered Grail&lt;/title&gt;
        &lt;genre&gt;Fantasy&lt;/genre&gt;
        &lt;price&gt;5.95&lt;/price&gt;
        &lt;publish_date&gt;2001-09-10&lt;/publish_date&gt;
        &lt;description&gt;The two daughters of Maeve, half-sisters, 
        battle one another for control of England. Sequel to 
        Oberon's Legacy.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk106&quot;&gt;
        &lt;author&gt;Randall, Cynthia&lt;/author&gt;
        &lt;title&gt;Lover Birds&lt;/title&gt;
        &lt;genre&gt;Romance&lt;/genre&gt;
        &lt;price&gt;4.95&lt;/price&gt;
        &lt;publish_date&gt;2000-09-02&lt;/publish_date&gt;
        &lt;description&gt;When Carla meets Paul at an ornithology 
        conference, tempers fly as feathers get ruffled.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk107&quot;&gt;
        &lt;author&gt;Thurman, Paula&lt;/author&gt;
        &lt;title&gt;Splish Splash&lt;/title&gt;
        &lt;genre&gt;Romance&lt;/genre&gt;
        &lt;price&gt;4.95&lt;/price&gt;
        &lt;publish_date&gt;2000-11-02&lt;/publish_date&gt;
        &lt;description&gt;A deep sea diver finds true love twenty 
        thousand leagues beneath the sea.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk108&quot;&gt;
        &lt;author&gt;Knorr, Stefan&lt;/author&gt;
        &lt;title&gt;Creepy Crawlies&lt;/title&gt;
        &lt;genre&gt;Horror&lt;/genre&gt;
        &lt;price&gt;4.95&lt;/price&gt;
        &lt;publish_date&gt;2000-12-06&lt;/publish_date&gt;
        &lt;description&gt;An anthology of horror stories about roaches,
        centipedes, scorpions  and other insects.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk109&quot;&gt;
        &lt;author&gt;Kress, Peter&lt;/author&gt;
        &lt;title&gt;Paradox Lost&lt;/title&gt;
        &lt;genre&gt;Science Fiction&lt;/genre&gt;
        &lt;price&gt;6.95&lt;/price&gt;
        &lt;publish_date&gt;2000-11-02&lt;/publish_date&gt;
        &lt;description&gt;After an inadvertant trip through a Heisenberg
        Uncertainty Device, James Salway discovers the problems 
        of being quantum.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk110&quot;&gt;
        &lt;author&gt;O'Brien, Tim&lt;/author&gt;
        &lt;title&gt;Microsoft .NET: The Programming Bible&lt;/title&gt;
        &lt;genre&gt;Computer&lt;/genre&gt;
        &lt;price&gt;36.95&lt;/price&gt;
        &lt;publish_date&gt;2000-12-09&lt;/publish_date&gt;
        &lt;description&gt;Microsoft's .NET initiative is explored in 
        detail in this deep programmer's reference.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk111&quot;&gt;
        &lt;author&gt;O'Brien, Tim&lt;/author&gt;
        &lt;title&gt;MSXML3: A Comprehensive Guide&lt;/title&gt;
        &lt;genre&gt;Computer&lt;/genre&gt;
        &lt;price&gt;36.95&lt;/price&gt;
        &lt;publish_date&gt;2000-12-01&lt;/publish_date&gt;
        &lt;description&gt;The Microsoft MSXML3 parser is covered in 
        detail, with attention to XML DOM interfaces, XSLT processing, 
        SAX and more.&lt;/description&gt;
     &lt;/book&gt;
     &lt;book id=&quot;bk112&quot;&gt;
        &lt;author&gt;Galos, Mike&lt;/author&gt;
        &lt;title&gt;Visual Studio 7: A Comprehensive Guide&lt;/title&gt;
        &lt;genre&gt;Computer&lt;/genre&gt;
        &lt;price&gt;49.95&lt;/price&gt;
        &lt;publish_date&gt;2001-04-16&lt;/publish_date&gt;
        &lt;description&gt;Microsoft Visual Studio 7 is explored in depth,
        looking at how Visual Basic, Visual C++, C#, and ASP+ are 
        integrated into a comprehensive development 
        environment.&lt;/description&gt;
     &lt;/book&gt;
  &lt;/catalog&gt;
  </code></pre>
  <p>One more, could we have parse xml from url with lxml.</p>
  <p>Thanks &amp; Best Regards,</p>