public function addChild($name, $value=null, $namespace=null)
    {
        $esc_val = utf8_encode(htmlentities($value, ENT_QUOTES, 'UTF-8', false));
        if ($value == $esc_val)
            return parent::addChild($name, $esc_val, $namespace);
        else {
            $xml_field = parent::addChild($name, '', $namespace);
            $xml_field->addCData($esc_val);
            $xml_field->addAttribute('isCDATA', true);

            return $xml_field;
        }
    }