title: 'externalptr' error in R using XML data
body: <p>I am working with some XML data in R and running into errors regarding type 'externalptr'.  </p>
  
  <p>1) I get the following error when I try to use the xmlInternalTreeParse() function (part of XML package).</p>
  
  <pre><code> doc = xmlInternalTreeParse(xmldatavariable)
      'Error in as.vector(x, "character") : cannot coerce type 'externalptr'
   to vector of type 'character''
  </code></pre>
  
  <p>2) I get this error when I try to write the XML data to a text file so I can look at it and see what the error might be.</p>
  
  <pre><code>write(xmldatavariable,"sample.txt")
  Error in cat(list(...), file, sep, fill, labels, append) : 
        argument 1 (type 'externalptr') cannot be handled by 'cat'
  </code></pre>
  
  <p>Any suggestions?  Thanks - Z</p>