# NOT RUN {
doc = xmlParse('<doc>
<page>
<p>A</p>
<p>B</p>
<p>C</p>
</page>
<page>
<p>D</p>
<p>E</p>
<p>F</p>
</page>
</doc>')
pages = getNodeSet(doc, "//page")
invisible(lapply(pages, replaceNodeWithChildren))
doc
# }
Run the code above in your browser using DataLab