docs: private void createNewContainerElements(CmsObject cms, CmsXmlContainerPage page, String sitePath)
      throws CmsException {
  
          CmsADEConfigData configData = OpenCms.getADEManager().lookupConfiguration(cms, cms.addSiteRoot(sitePath));
          Locale contentLocale = OpenCms.getLocaleManager().getDefaultLocale(cms, CmsResource.getFolderPath(sitePath));
          CmsObject cloneCms = OpenCms.initCmsObject(cms);
          cloneCms.getRequestContext().setLocale(contentLocale);
          CmsContainerPageBean pageBean = page.getContainerPage(cms);
          boolean needsChanges = false;
          List<CmsContainerBean> updatedContainers = new ArrayList<CmsContainerBean>();
          for (CmsContainerBean container : pageBean.getContainers().values()) {
              List<CmsContainerElementBean> updatedElements = new ArrayList<CmsContainerElementBean>();
              for (CmsContainerElementBean element : container.getElements()) {
                  if (element.isCreateNew() && !element.isGroupContainer(cms) && !element.isInheritedContainer(cms)) {
                      needsChanges = true;
                      String typeName = OpenCms.getResourceManager().getResourceType(element.getResource()).getTypeName();
                      CmsResourceTypeConfig typeConfig = configData.getResourceType(typeName);
                      if (typeConfig == null) {
                          throw new IllegalArgumentException(
                              "Can not copy template model element '"
                                  + element.getResource().getRootPath()
                                  + "' because the resource type '"
                                  + typeName
                                  + "' is not available in this sitemap.");
                      }
  
                      CmsResource newResource = typeConfig.createNewElement(
                          cloneCms,
                          element.getResource(),
                          CmsResource.getParentFolder(cms.getRequestContext().addSiteRoot(sitePath)));
                      CmsContainerElementBean newBean = new CmsContainerElementBean(
                          newResource.getStructureId(),
                          element.getFormatterId(),
                          element.getIndividualSettings(),
                          false);
                      updatedElements.add(newBean);
                  } else {
                      updatedElements.add(element);
                  }
              }
  
              CmsContainerBean updatedContainer = new CmsContainerBean(
                  container.getName(),
                  container.getType(),
                  container.getParentInstanceId(),
                  container.isRootContainer(),
                  container.getMaxElements(),
                  updatedElements);
              updatedContainers.add(updatedContainer);
          }
          if (needsChanges) {
              CmsContainerPageBean updatedPage = new CmsContainerPageBean(updatedContainers);
              page.writeContainerPage(cms, updatedPage);
          }
      }