@ 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 ; }
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 .