title: libxml2 HTML parsing
body: <p>I'm parsing HTML with libxml2, using XPath to find elements. Once I found the element I'm looking for, how can I get the HTML as a string from that element (keeping in mind that this element will have many child elements). Given a document:</p>
  
  <pre><code>&lt;html&gt;
      &lt;header&gt;
          &lt;title&gt;Some document&lt;/title&gt;
      &lt;/header
  
      &lt;body&gt;
          &lt;p id="faq"&gt;
              Some kind of text &lt;a href="http://www.nowhere.com/"&gt;here&lt;/a&gt;.
          &lt;/p&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Say I retrieved the <code>body</code> element with XPath and then get the HTML for that, I'd like to end up with a string containing:</p>
  
  <pre><code>&lt;body&gt;
      &lt;p id="faq"&gt;
          Some kind of text &lt;a href="http://www.nowhere.com/"&gt;here&lt;/a&gt;.
      &lt;/p&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>How can I do this?</p>