Each XML document has one, and exactly one single root element.
This element encloses all following elements and is therefore the parent element to all the other elements. The end-tag of the child element is always before the end-tag of the parent element - this is called nested elements.
<parent>
<child>
</child>
</parent>
If the end-tag of a parent element occurs before the end-tag of the child element this is improperly nested and illegal in XML.