ownerDocument; $domElement->appendChild($domOwner->createCDATASection("{$value}")); } } /** * Add child node with value as CData * * @param string $name The child XML node name to add * @param string $value A text to add as CData * @return SimpleXMLElement */ public function addChildWithCData($name = '', $value = '') { $newChild = parent::addChild($name); if ($value) $this->addCDataToNode($newChild, "{$value}"); return $newChild; } /** * Add value as CData to the current XML node * * @param string $value A text to add as CData * @return void */ public function addCData($value = '') { $this->addCDataToNode($this, "{$value}"); } }