Class Document

All Implemented Interfaces:
Node, Parent

public class Document extends NodeWithChildren implements Parent
This class represents an XML document.

If you add a ProcessingInstruction as the first node of the document, it will be converted into an XMLDeclaration.

Note: The automatic creation of XMLDeclaration is not perfect; if you manipulate the list of nodes yourself (for example, via getNodes().add()), then you're on your own.