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