These types of nodes are used to represent a document as a tree:
A document node roots the tree. It will always have as its child an element node for the outermost element of the document. It may also have comment or processing instruction nodes as children, if those nodes appear outside the document.
Each element node represents one XML tag and its children, if any.
Attribute nodes represent attributes of an element. Such nodes have element nodes as a parent, but are not considered ordinary children of the parent element.
Chunks of text inside an element become text nodes.
Comments in the document are represented as comment nodes.
Processing instructions come from