/** * Write XML to file and free the DOM objects. */ public function close() { $this->out->write($this->doc->saveXML()); $this->rootNode = null; $this->doc = null; parent::close(); }