public function addChild($name, $value = null)
    {
        $nameUtf8 = $this->_toUTF8($name);
        if ($value == null) {
            return new SimpleXMLExtended($this->_SimpleXmlElement->addChild($nameUtf8), $this->_encoding);
        } else {
            $valueUtf8 = htmlspecialchars($this->_toUTF8($value), ENT_COMPAT, "UTF-8");

            return new SimpleXMLExtended($this->_SimpleXmlElement->addChild($nameUtf8, $valueUtf8), $this->_encoding);
        }
    }
public function addChild($name, $value = null)
    {
        $nameUtf8 = $this->_toUTF8($name);
        if ($value == null) {
            return new SimpleXMLExtended($this->_SimpleXmlElement->addChild($nameUtf8), $this->_encoding);
        } else {
            $valueUtf8 = htmlspecialchars($this->_toUTF8($value), ENT_COMPAT, "UTF-8");

            return new SimpleXMLExtended($this->_SimpleXmlElement->addChild($nameUtf8, $valueUtf8), $this->_encoding);
        }
    }
public function addChild ( $ name , $ value = null ) { $ nameUtf8 = $ this -> _toUTF8 ( $ name ) ; if ( $ value == null ) { return new SimpleXMLExtended ( $ this -> _SimpleXmlElement -> addChild ( $ nameUtf8 ) , $ this -> _encoding ) ; } else { $ valueUtf8 = htmlspecialchars ( $ this -> _toUTF8 ( $ value ) , ENT_COMPAT , "UTF-8" ) ; return new SimpleXMLExtended ( $ this -> _SimpleXmlElement -> addChild ( $ nameUtf8 , $ valueUtf8 ) , $ this -> _encoding ) ; } }
insert a child element with or without a value, also doing conversation of name and if value is set to utf8

@param String $name  name of the child element
@param String $value a value that should be insert to the child

@return SimpleXMLExtended extended child SimpleXMLElement
insert a child element with or without a value also doing conversation of name and if value is set to utf8