title: How to get full HTML from DOMXPath::query() method?
body: <p>I have document from which I want to extract specific div with it's untouched content.
  I do:</p>
  
  <pre><code>$dom = new DOMDocument();
  $dom-&gt;loadHTML($string);//that's HTML of my document, string
  </code></pre>
  
  <p>and xpath query:</p>
  
  <pre><code>$xpath = new DOMXPath($dom);
  $xpath_resultset =  $xpath-&gt;query("//div[@class='text']");
  /*I'm after div class="text"*/
  </code></pre>
  
  <p>now I do <code>item(0)</code> method on what I get with <code>$xpath_resultset</code></p>
  
  <pre><code>$my_content = $xpath_resultset-&gt;item(0);
  </code></pre>
  
  <p>what I get is object (not string) $my_content which I can echo or settype() to string, but as result I get is with fully stripped markup?</p>
  
  <p>What to do to get <strong>all</strong> from div class='text' here?</p>