I often come across invalid XML in the codebase, such as unquoted
attributes or unclosed tags, this is a request my fellow developers to
help ensure that our output meets the XHTML spec at all times, one way
to do help ensure this is to add:
$wgMimeType = 'application/xhtml+xml';
To LocalSettings.php, if you're using a Gecko browser for testing this
will activate its strict mode causing it to trow parsing errors if
finds invalid XML.