code: private static boolean containsDescendantOrSelf(PathQueryNode path) {
          LocationStepQueryNode[] steps = path.getPathSteps();
          int count = 0;
          for (int i = 0; i < steps.length; i++) {
              if (steps[i].getNameTest() != null && steps[i].getIncludeDescendants()) {
                  count++;
              }
          }
          return count == 1;
      }
docs: Returns <code>true</code> if <code>path</code> contains exactly one
  step with a descendant-or-self axis and an explicit name test; returns
  <code>false</code> otherwise.
  
  @param path the path node.
  @return <code>true</code> if <code>path</code> contains exactly one
  step with a descendant-or-self axis.