function GetXML()
    {
        //Start a new line, indent by the number indicated in $this->parents, add a <, and add the name of the tag
        $out = "\n".str_repeat("\t", $this->tagParents).'<'.$this->tagName;

        //For each attribute, add attr="value"
        foreach($this->tagAttrs as $attr => $value)
            $out .= ' '.$attr.'="'.$value.'"';
        
        //If there are no children and it contains no data, end it off with a />
        if(empty($this->tagChildren) && empty($this->tagData))
            $out .= " />";
        
        //Otherwise...
        else
        {    
            //If there are children
            if(!empty($this->tagChildren))        
            {
                //Close off the start tag
                $out .= '>';
                
                //For each child, call the GetXML function (this will ensure that all children are added recursively)
                foreach($this->tagChildren as $child)
                {
                    if(is_object($child))
                        $out .= $child->GetXML();
                }

                //Add the newline and indentation to go along with the close tag
                $out .= "\n".str_repeat("\t", $this->tagParents);
            }
            
            //If there is data, close off the start tag and add the data
            elseif(!empty($this->tagData))
                $out .= '>'.$this->tagData;
            
            //Add the end tag    
            $out .= '</'.$this->tagName.'>';
        }
        
        //Return the final output
        return $out;
    }
function GetXML()
    {
        //Start a new line, indent by the number indicated in $this->parents, add a <, and add the name of the tag
        $out = "\n".str_repeat("\t", $this->tagParents).'<'.$this->tagName;

        //For each attribute, add attr="value"
        foreach($this->tagAttrs as $attr => $value)
            $out .= ' '.$attr.'="'.$value.'"';
        
        //If there are no children and it contains no data, end it off with a />
        if(empty($this->tagChildren) && empty($this->tagData))
            $out .= " />";
        
        //Otherwise...
        else
        {    
            //If there are children
            if(!empty($this->tagChildren))        
            {
                //Close off the start tag
                $out .= '>';
                
                //For each child, call the GetXML function (this will ensure that all children are added recursively)
                foreach($this->tagChildren as $child)
                {
                    if(is_object($child))
                        $out .= $child->GetXML();
                }

                //Add the newline and indentation to go along with the close tag
                $out .= "\n".str_repeat("\t", $this->tagParents);
            }
            
            //If there is data, close off the start tag and add the data
            elseif(!empty($this->tagData))
                $out .= '>'.$this->tagData;
            
            //Add the end tag    
            $out .= '</'.$this->tagName.'>';
        }
        
        //Return the final output
        return $out;
    }
function GetXML ( ) { //Start a new line, indent by the number indicated in $this->parents, add a <, and add the name of the tag $ out = "\n" . str_repeat ( "\t" , $ this -> tagParents ) . '<' . $ this -> tagName ; //For each attribute, add attr="value" foreach ( $ this -> tagAttrs as $ attr => $ value ) $ out .= ' ' . $ attr . '="' . $ value . '"' ; //If there are no children and it contains no data, end it off with a /> if ( empty ( $ this -> tagChildren ) && empty ( $ this -> tagData ) ) $ out .= " />" ; //Otherwise... else { //If there are children if ( ! empty ( $ this -> tagChildren ) ) { //Close off the start tag $ out .= '>' ; //For each child, call the GetXML function (this will ensure that all children are added recursively) foreach ( $ this -> tagChildren as $ child ) { if ( is_object ( $ child ) ) $ out .= $ child -> GetXML ( ) ; } //Add the newline and indentation to go along with the close tag $ out .= "\n" . str_repeat ( "\t" , $ this -> tagParents ) ; } //If there is data, close off the start tag and add the data elseif ( ! empty ( $ this -> tagData ) ) $ out .= '>' . $ this -> tagData ; //Add the end tag     $ out .= '</' . $ this -> tagName . '>' ; } //Return the final output return $ out ; }
Returns the string of the XML document which would be generated from this object

This function works recursively, so it gets the XML of itself and all of its children, which
in turn gets the XML of all their children, which in turn gets the XML of all thier children,
and so on. So, if you call GetXML from the document root object, it will return a string for
the XML of the entire document.

This function does not, however, return a DTD or an XML version/encoding tag. That should be
handled by MultiotpXmlParser::GetXML()

@return string
Returns the string of the XML document which would be generated from this object