docs: private boolean preValidateXML(final KeyValueNode<String> keyValueNode, final String wrappedValue, final String format) {
          Document doc = null;
  
          String errorMsg = null;
          try {
              String fixedXML = DocBookUtilities.escapeForXML(wrappedValue);
              if (CommonConstants.DOCBOOK_50_TITLE.equalsIgnoreCase(format)) {
                  fixedXML = DocBookUtilities.addDocBook50Namespace(fixedXML);
              }
              doc = XMLUtilities.convertStringToDocument(fixedXML);
          } catch (Exception e) {
              errorMsg = e.getMessage();
          }
  
          // If the doc variable is null then an error occurred somewhere
          if (doc == null) {
              final String line = keyValueNode.getText();
              if (errorMsg != null) {
                  log.error(String.format(ProcessorConstants.ERROR_INVALID_METADATA_MSG, keyValueNode.getKey(), errorMsg, line));
              } else {
                  log.error(String.format(ProcessorConstants.ERROR_INVALID_METADATA_NO_ERROR_MSG, keyValueNode.getKey(), line));
              }
  
              return false;
          }
  
          return true;
      }