1\name{replaceNodeWithChildren} 2\alias{replaceNodeWithChildren} 3\title{Replace an XML node with it child nodes} 4\description{ 5 This function can be used to flatten parts of an XML tree. 6 This takes a node and removes itself from the tree, but places 7 its kids in it place. 8} 9\usage{ 10replaceNodeWithChildren(node) 11} 12\arguments{ 13 \item{node}{an \code{XMLInternalNode} object} 14} 15\value{ 16 \code{NULL}. The purpose of this function is to modify the internal document. 17} 18\references{ 19libxml2 documentation. 20} 21\author{ 22Duncan Temple Lang 23} 24 25\examples{ 26doc = xmlParse('<doc> 27 <page> 28 <p>A</p> 29 <p>B</p> 30 <p>C</p> 31 </page> 32 <page> 33 <p>D</p> 34 <p>E</p> 35 <p>F</p> 36 </page> 37 </doc>') 38 39pages = getNodeSet(doc, "//page") 40invisible(lapply(pages, replaceNodeWithChildren)) 41doc 42} 43\keyword{IO} 44 45 46