+ Start a Discussion

Formatting an XML string to show indents (ie. pretty print)

I have Apex code in a controller class that uses the XMLStreamWriter to create an XML string and display the string on a Visualforce Page.  Everything is working fine except I can't find a graceful way to display the XML with indents (ie. pretty print) on the page.


Do I have to hard code the line breaks or is there a better solution I'm just not aware of?


Thanks in advance.

gresy pritty 8gresy pritty 8
The Capital One card has no foreign transaction fees, making it a great travel companion. Capital One Active Card