title: Convert XMLInternalDocument to character vector
body: <p>What is the best way to cast an object from the <code>{XML}</code> package back to a "normal" R character vector? </p>
  
  <p>For example:</p>
  
  <pre><code>require(XML)
  doc &lt;- htmlParse("http://cran.r-project.org/web/packages/XML/index.html")
  class(doc)
  # [1] "HTMLInternalDocument" "HTMLInternalDocument" 
  # "XMLInternalDocument"  "XMLAbstractDocument" 
  </code></pre>
  
  <p>Similar to <a href="https://stackoverflow.com/questions/6239119/how-to-convert-object-of-class-htmlinternaldocument-xmlinternaldocument-in">this</a> suggestion, I could do this:</p>
  
  <pre><code>doc.char &lt;- capture.output(doc)
  </code></pre>
  
  <p>But this seems like a circuitous route. However, I didn't find any other appropriate method. And this bugged me already a few times.</p>