title: R: convert XML data to data frame
body: <p>For a homework assignment I am attempting to convert an XML file into a data frame in R. I have tried many different things, and I have searched for ideas on the internet but have been unsuccessful. Here is my code so far:</p>
  
  <pre><code>library(XML)
  url &lt;- 'http://www.ggobi.org/book/data/olive.xml'
  doc &lt;- xmlParse(myUrl)
  root &lt;- xmlRoot(doc)
  
  dataFrame &lt;- xmlSApply(xmltop, function(x) xmlSApply(x, xmlValue))
  data.frame(t(dataFrame),row.names=NULL)
  </code></pre>
  
  <p>The output I get is like a giant vector of numbers. I am attempting to organize the data into a data frame, but I do not know how to properly adjust my code to obtain that.</p>