code: public static void wrapForRendering(final Document xmlDoc) {
          // Some topics need to be wrapped up to be rendered properly
          final String documentElementNodeName = xmlDoc.getDocumentElement().getNodeName();
          if (documentElementNodeName.equals("authorgroup") || documentElementNodeName.equals("legalnotice")) {
              final Element currentChild = xmlDoc.createElement(documentElementNodeName);
  
              xmlDoc.renameNode(xmlDoc.getDocumentElement(), xmlDoc.getNamespaceURI(), "book");
              final Element bookInfo = xmlDoc.createElement("bookinfo");
              xmlDoc.getDocumentElement().appendChild(bookInfo);
              bookInfo.appendChild(currentChild);
  
              final NodeList existingChildren = xmlDoc.getDocumentElement().getChildNodes();
              for (int childIndex = 0; childIndex < existingChildren.getLength(); ++childIndex) {
                  final Node child = existingChildren.item(childIndex);
                  if (child != bookInfo) {
                      currentChild.appendChild(child);
                  }
              }
          }
      }
docs: Some docbook elements need to be wrapped up so they can be properly transformed by the docbook XSL.
  
  @param xmlDoc