Essentially, the document tree is a document structured (in main memory) as a tree (data type). The nodes of the tree are objects (in the OOP sense) of type HTMLElement.
The parent-child relationships of the tree represent the relationship contains of the serialized, UTF-8 representation of the document. For example, in the serialized document, the
html element directly contains the
head element. And in the document tree, the
html element object is the direct parent of the
body element object. Further, the order that siblings occur in the tree represent the order that element occur in the serialized document. For example, in an HTML document, the
html element contains a
head element immediately followed by a
body element. And in the document tree, the
head element would be the first sibling of
body would be the second sibling.
Syntactic definition of an HTML element in the serialized document.