Each XML document has exactly one single root element.
[1] The World Wide Web Consortium defines not only the specifications for XML itself,[2] but also the DOM, which is a platform- and language-independent standard object model for representing XML documents.
[4] In particular, the root element may be preceded by a prolog, which itself may consist of an XML declaration, optional comments, processing instructions and whitespace, followed by an optional DOCTYPE declaration and more optional comments, processing instructions and whitespace.
After the root element, there may be further optional comments, processing instructions and whitespace within the document.
A more expanded example of an XML document follows, demonstrating some of these extra nodes along with a single rootElement element.