/** * Dumps the internal XML tree back into a string with added whitespace * (new-lines and tabbing). * * @param optional object DOMNode $node * @param optional int $options * @return string * @access public * @since 1/23/08 */ public function saveXMLWithWhitespace(DOMNode $node = null, $options = null) { $doc = new Harmoni_DOMDocument(); if (is_null($node)) { if ($this->documentElement) { $doc->appendChild($doc->importNode($this->documentElement, true)); } } else { $doc->appendChild($doc->importNode($node, true)); } $doc->addWhitespaceToDocument(); return $doc->saveXML($doc->documentElement, $options); }