_dom->createElement($name); $this->_currentElement = $this->_currentElement->appendChild($newElement); if ($value !== null) { $this->_currentElement->appendChild($this->_dom->createTextNode($value)); } return $this; } /** * End of an XML element * * Resets $_currentElement to the next parent node in the hierarchy * * @param string $name * @return Zend_XmlRpc_Generator_DomDocument Fluent interface */ public function endElement($name) { if (isset($this->_currentElement->parentNode)) { $this->_currentElement = $this->_currentElement->parentNode; } return $this; } /** * Save XML as a string * * @return string */ public function saveXml() { return $this->_dom->saveXml(); } /** * Initializes internal objects * * @return void */ protected function _init() { $this->_dom = new DOMDocument('1.0', $this->_encoding); $this->_currentElement = $this->_dom; } }