public function exportValue(\SimpleXMLElement $akv) { $val = $this->attributeValue->getValue(); if (is_object($val)) { $val = (string) $val; } $cnode = $akv->addChild('value'); $node = dom_import_simplexml($cnode); $no = $node->ownerDocument; $node->appendChild($no->createCDataSection($val)); return $cnode; }