code: private String getSubPath(CmsObject cms, CmsResource xmlPage, String resourcename) {
  
          if (xmlPage != null) {
              String rootPath = cms.getRequestContext().addSiteRoot(resourcename);
              String path = rootPath.substring(xmlPage.getRootPath().length());
  
              if (path.startsWith("/")) {
                  path = path.substring(1);
              }
  
              if (path.endsWith("/")) {
                  path = path.substring(0, path.length() - 1);
              }
  
              return path;
          }
  
          return null;
      }
docs: Returns the path inside a xml page.<p>
  
  The remaining path inside a xml page can be the locale and the element name
  or the name of the control code file.<p>
  
  @param cms the initialized CmsObject
  @param xmlPage the xml page where the resourcename belongs to
  @param resourcename the full path of the resource (pointing inside the xml page)
  
  @return the remaining path inside the xml page without the leading slash