I have a SOAPMessage (found in javax.xml.soap.SOAPMessage).
However the only way to print it seems to be soapMessage.writeTo(System.out); However this doesn't have any new lines and with a large SOAPMessage it can be difficult to read.
Further, using System.out.println(soapMessage.toString()); just prints out:
com.sun.xml.internal.messaging.saaj.soap.ver1_1.Message1_1Impl@76c7e77a
I looked at How to pretty print XML from Java?, How to print SOAPMessage and How to convert SOAPBody to String but neither fix the issue of newlines and/or formatting a SOAPMessage.