Made DOMDocument::saveXML() options configurable, closes #1171