code: public static ElementSelector byXPath(final String xpath,
                                            Map<String, String> prefix2Uri,
                                            ElementSelector childSelector) {
          final XPathEngine engine = new JAXPXPathEngine();
          if (prefix2Uri != null) {
              engine.setNamespaceContext(prefix2Uri);
          }
          final NodeMatcher nm = new DefaultNodeMatcher(childSelector);
          return new ElementSelector() {
              @Override
              public boolean canBeCompared(Element controlElement,
                                           Element testElement) {
                  Iterable<Node> controlChildren = engine.selectNodes(xpath, controlElement);
                  int expected = Linqy.count(controlChildren);
                  int matched =
                      Linqy.count(nm.match(controlChildren,
                                           engine.selectNodes(xpath, testElement)));
                  return expected == matched;
              }
          };
      }
docs: Selects two elements as matching if the child elements selected
  via XPath match using the given childSelector.
  
  <p>The xpath expression should yield elements.  Two elements
  match if a DefaultNodeMatcher applied to the selected children
  finds matching pairs for all children.</p>
  
  @param xpath XPath expression applied in the context of the
  elements to chose from that selects the children to compare.
  @param prefix2Uri maps from prefix to namespace URI.
  @param childSelector ElementSelector to apply to the selected children.