public XML addChild(XML child) { Document document = node.getOwnerDocument(); Node newChild = document.importNode((Node) child.getNative(), true); return appendChild(newChild); }
private void appendNodes(Document doc, Node target, NodeList nodes) { for (int i = 0; i < nodes.getLength(); i++) { Node node = nodes.item(i); target.appendChild(doc.importNode(node, true)); } }