code: public static String convertDocumentToDocBookFormattedString(final DocBookVersion docBookVersion, final Document doc,
              final String elementName, final String entityName, final XMLFormatProperties xmlFormatProperties) {
          final String formattedXML = convertDocumentToFormattedString(doc, xmlFormatProperties);
          return addDocBookPreamble(docBookVersion, formattedXML, elementName, entityName);
      }
docs: Convert a DOM Document to a DocBook Formatted String representation including the XML preamble and DOCTYPE/namespaces.
  
  @param docBookVersion      The DocBook version to add the preamble content for.
  @param doc                 The DOM Document to be converted and formatted.
  @param elementName         The name that the root element should be.
  @param entityName          The name of the local entity file, if one exists.
  @param xmlFormatProperties The XML Formatting Properties.
  @return The converted XML String representation.