code: public void actionNew() throws JspException {
  
          String newFileName = "";
          try {
              newFileName = A_CmsResourceCollector.createResourceForCollector(
                  getCms(),
                  m_paramNewLink,
                  getElementLocale(),
                  getParamResource(),
                  getParamModelFile(),
                  getParamMode(),
                  getParamPostCreateHandler());
              // wipe out parameters for the editor to ensure proper operation
              setParamNewLink(null);
              setParamAction(null);
              setParamResource(newFileName);
              setAction(ACTION_DEFAULT);
  
              // create the temporary file to work with
              setParamTempfile(createTempFile());
  
              // set the member variables for the content
              m_file = getCms().readFile(getParamTempfile(), CmsResourceFilter.ALL);
              if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(getParamModelFile())) {
                  m_content = CmsXmlContentFactory.unmarshal(
                      getCms(),
                      getCms().readFile(newFileName, CmsResourceFilter.ALL));
              } else {
                  m_content = CmsXmlContentFactory.unmarshal(getCms(), m_file);
              }
  
          } catch (CmsException e) {
              if (LOG.isErrorEnabled()) {
                  LOG.error(Messages.get().getBundle().key(Messages.LOG_CREATE_XML_CONTENT_ITEM_1, m_paramNewLink), e);
              }
              throw new JspException(e);
          } finally {
              try {
                  // delete the new file
                  getCms().deleteResource(newFileName, CmsResource.DELETE_REMOVE_SIBLINGS);
              } catch (CmsException e) {
                  // ignore
              }
          }
      }
docs: Creates a new XML content item for editing.<p>
  
  @throws JspException in case something goes wrong