Use DOMDocument LIBXML_PARSEHUGE and LIBXML_COMPACT options if possible (#1489302)