code: public static boolean contains(Element parent, Element descendant) {
      return parent != descendant && parent.isOrHasChild(descendant);
    }
docs: Return true if the <code>descendant</code> is a child of the parent. Return false elsewhere.