Very useful to add a CDATA node with SimpleXMLElement (use it like addChild) :
<?php
class My_SimpleXMLElement extends SimpleXMLElement {
public function addChildWithCData($name, $value = NULL) {
$new_child = $this->addChild($name);
$node = dom_import_simplexml($new_child);
$no = $node->ownerDocument;
$node->appendChild($no->createCDATASection($value));
return $new_child;
}
}