code: public Node root() {
          Node node = this;
          while (node.parentNode != null)
              node = node.parentNode;
          return node;
      }
docs: Get this node's root node; that is, its topmost ancestor. If this node is the top ancestor, returns {@code this}.
  @return topmost ancestor.