code: protected CmsObject rootCms(CmsObject cms) throws CmsException {
  
          CmsObject result = OpenCms.initCmsObject(cms);
          result.getRequestContext().setSiteRoot("");
          return result;
      }
docs: Creates a new CMS object based on existing one and changes its site root to the site root.<p>
  
  @param cms the CMS context
  @return the root site CMS context
  @throws CmsException if something goes wrong