code: public QPathEntry[] getRelPath(int relativeDegree) throws IllegalPathException
     {
  
        int len = getLength() - relativeDegree;
        if (len < 0)
           throw new IllegalPathException("Relative degree " + relativeDegree + " is more than depth for "
              + getAsString());
  
        QPathEntry[] relPath = new QPathEntry[relativeDegree];
        System.arraycopy(names, len, relPath, 0, relPath.length);
  
        return relPath;
     }
docs: Get relative path with degree.
  
  @param relativeDegree
  - degree value
  @return arrayf of QPathEntry
  @throws IllegalPathException
  - if the degree is invalid