private function newDom(&$options) { $dom = new \DOMDocument($options['version'], $options['encoding']); $dom->formatOutput = true; $dom->preserveWhiteSpace = false; return $dom; }