docs: protected Element createRootContainerXML(final BuildData buildData, final Document doc, final Level level,
              final boolean flattenStructure) throws BuildProcessingException {
          // Check if the app should be shutdown
          if (isShuttingDown.get()) {
              return null;
          }
  
          // Get the name of the element based on the type
          final String elementName = level.getLevelType() == LevelType.PROCESS ? "chapter" : level.getLevelType().getTitle().toLowerCase(
                  Locale.ENGLISH);
  
          Document container = null;
          try {
              container = XMLUtilities.convertStringToDocument("<" + elementName + "></" + elementName + ">");
          } catch (Exception ex) {
              // Exit since we shouldn't fail at converting a basic chapter
              log.debug("", ex);
              throw new BuildProcessingException(getMessages().getString("FAILED_CREATING_BASIC_TEMPLATE"));
          }
  
          // Create the title
          final String containerName = level.getUniqueLinkId(buildData.isUseFixedUrls());
          final String containerXMLName = containerName + ".xml";
  
          // Create the xiInclude to be added to the book.xml file
          final Element xiInclude = XMLUtilities.createXIInclude(doc, containerXMLName);
  
          // Setup the title and id
          setUpRootElement(buildData, level, container, container.getDocumentElement());
  
          // Create and add the chapter/level contents
          createContainerXML(buildData, level, container, container.getDocumentElement(),
                  buildData.getBookTopicsFolder() + containerName + "/", flattenStructure);
  
          // Add the boiler plate text and add the chapter to the book
          final String chapterString = DocBookBuildUtilities.convertDocumentToDocBookFormattedString(buildData.getDocBookVersion(), container,
                  elementName, buildData.getEntityFileName(), getXMLFormatProperties());
          addToZip(buildData.getBookLocaleFolder() + containerXMLName, chapterString, buildData);
  
          return xiInclude;
      }