code: @Override
    public String prettyPrint(String xml) {
      if (xml == null) {
        return xml;
      }
      Source xmlSource = sanitizeXml(xml);
      if (xmlSource == null) {
        xmlSource = new StreamSource(new StringReader(xml));
      }
      String formattedXml = formatXml(xmlSource);
      return formattedXml != null ? formattedXml : xml;
    }
docs: Transforms XML into a pretty-printed format with sensitive strings removed.
  If there is an error initializing formatting the XML message, the formatting
  step will be skipped and the unformatted XML with sensitive strings removed
  will be returned.
  
  @param xml the XML message to be pretty printed
  @return the given message in pretty-printed format