code: protected void saveContainerPage(CmsObject cms, Element parent, CmsContainerPageBean cntPage) throws CmsException {
  
          parent.clearContent();
  
          // save containers in a defined order
          List<String> containerNames = new ArrayList<String>(cntPage.getNames());
          Collections.sort(containerNames);
  
          for (String containerName : containerNames) {
              CmsContainerBean container = cntPage.getContainers().get(containerName);
  
              // the container
              Element cntElement = parent.addElement(XmlNode.Containers.name());
              cntElement.addElement(XmlNode.Name.name()).addCDATA(container.getName());
              cntElement.addElement(XmlNode.Type.name()).addCDATA(container.getType());
              if (container.isNestedContainer()) {
                  cntElement.addElement(XmlNode.ParentInstanceId.name()).addCDATA(container.getParentInstanceId());
              }
              if (container.isRootContainer()) {
                  cntElement.addElement(XmlNode.IsRootContainer.name()).addText(Boolean.TRUE.toString());
              }
  
              // the elements
              for (CmsContainerElementBean element : container.getElements()) {
                  Element elemElement = cntElement.addElement(XmlNode.Elements.name());
  
                  // the element
                  Element uriElem = elemElement.addElement(XmlNode.Uri.name());
                  CmsResource uriRes = fillResource(cms, uriElem, element.getId());
                  Element formatterElem = elemElement.addElement(XmlNode.Formatter.name());
                  fillResource(cms, formatterElem, element.getFormatterId());
                  if (element.isCreateNew()) {
                      Element createNewElem = elemElement.addElement(XmlNode.CreateNew.name());
                      createNewElem.addText(Boolean.TRUE.toString());
                  }
                  // the properties
                  Map<String, String> properties = element.getIndividualSettings();
                  Map<String, CmsXmlContentProperty> propertiesConf = OpenCms.getADEManager().getElementSettings(
                      cms,
                      uriRes);
  
                  CmsXmlContentPropertyHelper.saveProperties(cms, elemElement, properties, propertiesConf);
              }
          }
      }
docs: Adds the given container page to the given element.<p>
  
  @param cms the current CMS object
  @param parent the element to add it
  @param cntPage the container page to add
  
  @throws CmsException if something goes wrong