Improve how DOMParser/XMLSerializer are set.