As it was already mentioned DOM-document contains the only root element.
The root in its turn consists of nodes. XML-element are concrete types of
those node. Except elements nodes can be also comments, text, attribute,
notation, processing instruction and event the document it self.
Since when we request a child from an element we get a node of unknown type,
we may use its getNodeValue() method to indicates its type and to cast
to corresponding interface: