Code example for Document

Methods: importNodeappendChild

            if (elem.getOwnerDocument().getDocumentElement() == elem) {
                return elem.getOwnerDocument();
                // else, create a new doc and copy the element inside it 
            } else { 
                Document doc = createDocument();
                doc.appendChild(doc.importNode(node, true));
                return doc;
            // other element types are not handled 
        } else { 
            throw new TransformerException("Unable to convert DOM node to a Document");
     * Converts the source instance to a StaxSource or returns null if the 
     * conversion is not supported (making it easy to derive from this class 
     * to add new kinds of conversion). 
     * @param source the source 
Contextual code suggestions in your IDE  Get Codota for Java