Create XML document using nodeList
You should do it like this: you create a new org.w3c.dom.Document newXmlDoc where you store the nodes in your NodeList, you create a new root element, and append it to newXmlDoc then, for each node n in your NodeList, you import n in newXmlDoc, and then you append n as a child of root Here … Read more