title: How to convert xml data to data frame in R
body: <p>Hello guys,
               I need to load an xml file into a data frame in R. The xml format is as shown below. How do I acheive the same?</p>
  
  <pre><code>         &lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;posts&gt;  &lt;row Id="1" PostTypeId="1" AcceptedAnswerId="17" CreationDate="2010-07-26T19:14:18.907" Score="6"/&gt;&lt;/posts&gt;
  </code></pre>
  
  <p>I tried the below code....It does not give the desired output. I am expecting a tabular output with the column names and their values listed below.</p>
  
  <pre><code>library(XML)
  xml.url ="test.xml"
  xmlfile = xmlTreeParse(xml.url)
  
  class(xmlfile)
  xmltop=xmlRoot(xmlfile)
  
  print(xmltop)[1:2]
  
  plantcat &lt;- xmlSApply(xmltop, function(x) xmlSApply(x, xmlValue))
  
  plantcat_df &lt;- data.frame(t(plantcat))
  </code></pre>