XML documents form a tree structure that starts at
the root
An
XML tree
starts at a
root element
and branches from the root to
child elements
<root>
<child>
<subchild>.....</subchild>
</child>
</root>
The terms
parent
,
child
, and
sibling
are used to describe the relationships between elements.
...
Parents
have children.
Children
have parents.
Siblings
are children on the same level (brothers and sisters).
...
We can use any of the online XML tree viewer tools to see the document's tree structure, like this one:
https://www.xmlviewer.org/
Books
XML document to see on tree-viewer
<books>
<book category="cooking">
<title lang="en">The goals</title>
<author>Giada De Laurentiis</author>
<year>2007</year>
<price>30.00</price>
</book>
<book category="children">
<title lang="en">12 rules for life</title>
<author>J K. Rowling</author>
<year>2002</year>
<price>29.99</price>
</book>
<book category="web">
<title lang="en">The richest man in Babilon</title>
<author>Erik T. Ray</author>
<year>2001</year>
<price>39.95</price>
</book>
</books>