...
Once the Document object is created, you don't directly create new DOM objects; instead, each DOM object includes methods that create new sub-objects. This primarily applies to the Element class, which can be a container of text, comments and other elements.
Document
The Document Object object represents the an entire document, which is to say, an entire response to be sent to the client.
...
The Document class also has methods for setting and getting the DTD, adding comments and text, and finding an element based on a path of element names.
Element
An Element Object object represents an element of the document. Elements may have attributes, and they may themselves contain other elements, as well as text and comments.
...