doc = new DOMDocument($version); $this->doc->formatOutput = TRUE; } function createElement($name) { $element = new Php5DomElement($this->doc->createElement($name)); if($this->root === null) { $this->root = $element; } return $element; } //this function needs to catch exceptions & return FALSE if one happens, to match behavior of the PHP 4 version function appendChild($newNode) { $this->doc->appendChild($newNode->getElement()); return $newNode; } function createComment($text) { return new Php5DomElement($this->doc->createComment($text)); } function saveXML() { $content = $this->doc->saveXML(); $content = str_replace(' ', "\t", $content); $content = str_replace("\n", '', $content); return $content; } } ?>