root property

XmlNode root

Return the root of the tree in which this node is found, whether that's a document or another element.

Implementation

XmlNode get root {
  var node = this;
  while (node.parent != null) {
    node = node.parent!;
  }
  return node;
}