Replaced use of htmlentities() in Util\XML with something better