XML Tree Structure
In this tutorial, the basic structure of XML document is described. XML documents must contain a root element. This element is “the parent” of all other elements.
The elements in an XML document form a document tree. XML tree structure is also called as tree model or hierarchical model. The tree structure starts at the root and branches to the lowest level of the tree.
The complex elements are represented with the help of internal nodes and simple elements are represented with leaf node.
All elements can have sub-elements (child elements):
The terms parent, child, and sibling are used to describe the relationships between elements. Parent elements have children. Children on the same level are called siblings (brothers or sisters).
All elements can have text content and attributes (just like in HTML). See the example below:
Figure 1: Example XML tree structure
Textual representation of the above document in the form of XML document can be as follows
<First name>Ajay</First name>
<Last name>Tendulkar</Last name>
<Street>M. G. road</Street>
<Zip code>411018</Zip code>