Return the root of the tree in which this node is found, whether that's a document or another element.
@override XmlNode get root { XmlNode current = this; while (current.parent != null) { current = current.parent!; } return current; }