I'm sure this will have been asked before but I cant find it in the forums - How can I format the output of an XML file that has been created using DOMDocument so that it's tags are nested properly when viewing it in a text editor, By default it just outputs a single line with no breaks... or am I missing something?

Thanks in advance!