This uses 'xml2' package to do the parsing.

parse_inner(xml2_node, as_document = TRUE)

Arguments

xml2_node

root node of a document or an element node

as_document

whether or not to make the root node a document node. Otherwise just create an element node.