The Document Interface as a Node Type
In addition to the factory methods and the methods common to all nodes, the Document interface has unique methods that perform operations relevant only to document nodes. These include
Methods to find elements
A method to copy nodes from other documents
The Document interface has three methods that simply return particular parts of the document:
public Element getDocumentElement() public DocumentType getDoctype() public DOMImplementation getImplementation()
These are fairly self-explanatory. You've already seen the getDocumentElement() method used several times. It returns the Element object that represents the root element of the document. Similarly, the getDoctype() method ...