contains method

bool contains(
  1. XmlNode other
)

Test whether other is this node or contained in this node.

Implementation

bool contains(XmlNode other) {
  for (XmlNode? node = other; node != null; node = node.parent) {
    if (this == node) {
      return true;
    }
  }
  return false;
}