So what is it, really?
From a conceptual point of view
An XML document is a labeled tree.
Often, comments, entity declarations, and DTD information is not explicitly
represented in the tree.
(Some prefer to have a special root node above the root element.)
- a leaf node is
- character data (a text string) - the actual data,
- a processing instruction - annotations for processors,
typically in document header,
- a comment - never any semantics attached,
- an entity declaration - simple macros, or
- DTD (Document Type Declaration) nodes (described later...)
- an internal node is an element, which is labeled with
- a name, and
- a set of attributes, each consisting of a name and a value.
Unfortunately, there is still no agreement on
XML tree terminology :-(