public function toXml()
    {
        // init
        $result = '';
        $tagName = ($this->namespace == '' ? '' : $this->namespace.':').$this->name;
        $attributes = '';
        foreach ($this->attributes as $attribute) {
            $attributes .= ' '.$attribute->Name.'="'.$attribute->Value.'"';
        }

        // action
        $result .= '<'.$tagName.$attributes.'>';
        foreach ($this->nodes as $node) {
            /** @var INode $node */
            $result .= $node->toXml();
        }
        $result .= '</'.$tagName.'>';

        // return
        return $result;
    }
public function toXml()
    {
        // init
        $result = '';
        $tagName = ($this->namespace == '' ? '' : $this->namespace.':').$this->name;
        $attributes = '';
        foreach ($this->attributes as $attribute) {
            $attributes .= ' '.$attribute->Name.'="'.$attribute->Value.'"';
        }

        // action
        $result .= '<'.$tagName.$attributes.'>';
        foreach ($this->nodes as $node) {
            /** @var INode $node */
            $result .= $node->toXml();
        }
        $result .= '</'.$tagName.'>';

        // return
        return $result;
    }
public function toXml ( ) { // init $ result = '' ; $ tagName = ( $ this -> namespace == '' ? '' : $ this -> namespace . ':' ) . $ this -> name ; $ attributes = '' ; foreach ( $ this -> attributes as $ attribute ) { $ attributes .= ' ' . $ attribute -> Name . '="' . $ attribute -> Value . '"' ; } // action $ result .= '<' . $ tagName . $ attributes . '>' ; foreach ( $ this -> nodes as $ node ) { /** @var INode $node */ $ result .= $ node -> toXml ( ) ; } $ result .= '</' . $ tagName . '>' ; // return return $ result ; }
Convert to XML.

@return string
Convert to XML .