如何使用混合内容精美打印XML

So I have a debate system where users should post their arguments and objections in the following format:

<argument>Argument about something.
    <objection>Objection to the argument.
        <objection>Objection to the objection.</objection>
    </objection>
    <objection>Second objection to the argument.</objection>
</argument>

But I cannot expect users to always get it right, so I need some way to normalize/prettify their input. I tried the standard way:

$dom = new DOMDocument;
$dom->preserveWhiteSpace = false;
$dom->loadXML('<argument>a<objection>b</objection></argument>');
$dom->formatOutput = true;
echo $dom->saveXml();

but unfortunately this outputs:

<argument>a<objection>b</objection></argument>

apparently it's because the standard PHP pretty-printing ignores all mixed content XML. I did some research and I think that XSL may be the key. But I never got into it before so I'm not sure yet. Can anyone confirm and give me a useful pointer or two? Maybe an example? Thanks!

Like the comments said, here are reasons that DOM behaves that way. Take this this example:

<text><firstChar>E</firstChar>xample</text>

A break/whitespace after the closing firstChar tag would change the meaning and display to the user.

The XSLT processor is a little different. It can recognize some more cases where it can break, so the formatting is different. If you're writing an XSLT template, whitespace between XSLT tags is ignored, while other whitespace is interpreted as a break. xsl:text allows you to get whitespace sequences passed trough as is. But this will not work for the nodes from the XML. They will be copied as is, because otherwise the meaning could change.