code: public static ElementSelector byNameAndAttributes(final QName... attribs) {
          if (attribs == null) {
              throw new IllegalArgumentException(ATTRIBUTES_MUST_NOT_BE_NULL);
          }
          final Collection<QName> qs = Arrays.asList(attribs);
          if (any(qs, new IsNullPredicate())) {
              throw new IllegalArgumentException(ATTRIBUTES_MUST_NOT_CONTAIN_NULL_VALUES);
          }
          return new ElementSelector() {
              @Override
              public boolean canBeCompared(Element controlElement,
                                           Element testElement) {
                  if (!byName.canBeCompared(controlElement, testElement)) {
                      return false;
                  }
                  return mapsEqualForKeys(Nodes.getAttributes(controlElement),
                                          Nodes.getAttributes(testElement),
                                          qs);
              }
          };
      }
docs: Elements with the same local name (and namespace URI - if any)
  and attribute values for the given attribute names can be
  compared.