code: public String createSessionForResource(String configPath, String fileName) throws CmsUgcException {
  
          CmsUgcSession formSession = CmsUgcSessionFactory.getInstance().createSessionForFile(
              getCmsObject(),
              getRequest(),
              configPath,
              fileName);
          return "" + formSession.getId();
      }
docs: Creates a new form session to edit the file with the given name using the given form configuration.
  
  @param configPath the site path of the form configuration
  @param fileName the name (not path) of the XML content to edit
  @return the id of the newly created form session
  
  @throws CmsUgcException if something goes wrong