Pull updates to Xml class from MediaWiki git repo

Restricted to changes which do not introduce new dependencies:
 * code style
 * code cleanup
 * documentation improvements

+header.