code: public boolean matches(LinkedList<Node> nodePath) {
          if(simplePattern) {
              // simple pattern
              return items.get(0).matches(nodePath.getLast());
          }
          // match the full pattern
          if(items.size() != nodePath.size()) {
              // different size
              return false;
          }
          for(int i=0; i<items.size(); i++) {
              if (! items.get(i).matches(nodePath.get(i))) {
                  // failed a comparison
                  return false;
              }
          }
          // pass all comparisons
          return true;
      }
docs: Compare an XML node path with the path query
  @param nodePath XML data path
  @return {@code boolean} true if a match