protected function addChild( $attribute, $value = null, $escape = false )
    {
        if ( ! empty( $value )) {
            if ($escape === true) {
                $node = $this->XML->createElement( $attribute );
                $node->appendChild( new \DOMCdataSection( $value ) );
            } else {
                $node = $this->XML->createElement( $attribute, $value );
            }
            $this->mainNode->appendChild( $node );
        }
    }
protected function addChild( $attribute, $value = null, $escape = false )
    {
        if ( ! empty( $value )) {
            if ($escape === true) {
                $node = $this->XML->createElement( $attribute );
                $node->appendChild( new \DOMCdataSection( $value ) );
            } else {
                $node = $this->XML->createElement( $attribute, $value );
            }
            $this->mainNode->appendChild( $node );
        }
    }
protected function addChild ( $ attribute , $ value = null , $ escape = false ) { if ( ! empty ( $ value ) ) { if ( $ escape === true ) { $ node = $ this -> XML -> createElement ( $ attribute ) ; $ node -> appendChild ( new \ DOMCdataSection ( $ value ) ) ; } else { $ node = $ this -> XML -> createElement ( $ attribute , $ value ) ; } $ this -> mainNode -> appendChild ( $ node ) ; } }
Adds a child node to the main node that each inherited class creates when it instantiates itself.

@param $attribute
@param null $value
@param bool $escape Whether to escape the value, we usually escape any field that might contain special characters
to avoid using special char handler methods
Adds a child node to the main node that each inherited class creates when it instantiates itself .