Manual:$wgWellFormedXml

Details
Whether to try to make our HTML output well-formed XML even if $wgHtml5 is true.

If set to false, output will be a few bytes shorter, and the HTML will arguably be more readable. If set to true, life will be much easier for the authors of screen-scraping bots, and the HTML will arguably be more readable. In version 1.16.0, this implies the doctype is changed to XHTML 1.0 Strict to make named character references work in XML. From version 1.17, named character references are avoided.