docs: protected Element createSubRootContainerXML(final BuildData buildData, final Document doc, final Level container,
              final String parentFileDirectory, 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 = container.getLevelType() == LevelType.PROCESS ? "chapter" : container.getLevelType().getTitle()
                  .toLowerCase(Locale.ENGLISH);
  
          Document chapter = null;
          try {
              chapter = 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 chapterName = container.getUniqueLinkId(buildData.isUseFixedUrls());
          final String chapterXMLName = chapterName + ".xml";
  
          // Setup the title and id
          setUpRootElement(buildData, container, chapter, chapter.getDocumentElement());
  
          // Create and add the chapter/level contents
          createContainerXML(buildData, container, chapter, chapter.getDocumentElement(), parentFileDirectory + chapterName + "/",
                  flattenStructure);
  
          // Add the boiler plate text and add the chapter to the book
          final String chapterString = DocBookBuildUtilities.convertDocumentToDocBookFormattedString(buildData.getDocBookVersion(), chapter,
                  elementName, buildData.getEntityFileName(), getXMLFormatProperties());
          addToZip(buildData.getBookLocaleFolder() + chapterXMLName, chapterString, buildData);
  
          // Create the XIncludes that will get set in the book.xml
          final Element xiInclude = XMLUtilities.createXIInclude(doc, chapterXMLName);
  
          return xiInclude;
      }