code: private CmsResource getResourceForLocale(CmsResource xmlPage, Locale locale) {
  
          CmsWrappedResource wrap = new CmsWrappedResource(xmlPage);
          wrap.setRootPath(xmlPage.getRootPath() + "/" + locale.getLanguage() + "/");
          int plainId;
          try {
              plainId = OpenCms.getResourceManager().getResourceType(
                  CmsResourceTypePlain.getStaticTypeName()).getTypeId();
          } catch (CmsLoaderException e) {
              // this should really never happen
              plainId = CmsResourceTypePlain.getStaticTypeId();
          }
          wrap.setTypeId(plainId);
          wrap.setFolder(true);
  
          return wrap.getResource();
      }
docs: Creates a new virtual resource for the locale in the xml page as a folder.<p>
  
  The new created resource uses the values of the origin resource of the xml page where it is possible.<p>
  
  @param xmlPage the xml page resource with the locale to create a resource of
  @param locale the locale in the xml page to use for the new resource
  
  @return a new created CmsResource