Вы можете записать это в файл и прочитать соответствующие разделы вашим любимым методом.
library(scrapeR)
f = system.file("exampleData", "mtcars.xml", package="XML")
doc = xmlTreeParse(f, useInternalNodes = TRUE)
sink("your.file.txt")
doc
sink()
Прочитать, например,
readLines("your.file.txt")
[1] "<?xml version=\"1.0\"?>"
[2] "<!DOCTYPE dataset SYSTEM \"../DatasetByRecord.dtd\">"
[3] "<!-- Taken from the R distribution, in turn taken from Henderson and Velleman 1981, "
[4] " Building multiple regression models interactively, Biometrics 37 391-411 . "
[5] "-->"
[6] "<dataset name=\"mtcars\" numRecords=\"32\" source=\"R Project\">"
[7] " <variables count=\"11\">"
[8] " <variable unit=\"Miles/gallon\">mpg</variable>"
[9] " <variable>cyl</variable>"