code: private static LocationPath compressAnywhere(LocationPath path){
          int noOfNulls = 0;
          Step steps[] = path.steps;
  
          Step prevStep = steps[0];
          for(int i=1, len=steps.length; i<len; i++){
              Step curStep = steps[i];
  
              if(!curStep.predicateSet.hasPosition && prevStep.predicateSet.getPredicate()==null){
                  if(prevStep.axis==Axis.DESCENDANT_OR_SELF && prevStep.constraint.id==Constraint.ID_NODE){
                      if(curStep.axis==Axis.CHILD){
                          steps[i-1] = null;
                          Step newStep = new Step(Axis.DESCENDANT, curStep.constraint);
                          newStep.setPredicate(curStep);
                          steps[i] = curStep = newStep;
                          noOfNulls++;
                      }
                  }
              }
              prevStep = curStep;
          }
          return noOfNulls>0 ? removeNullSteps(path, noOfNulls) : path;
      }
docs: "/descendant::book" if there are no predicates on first two steps