Horde_Xml_Element::saveXml PHP Method

saveXml() public method

Returns a string of this element's XML, including the XML prologue.
public saveXml ( $formatted = false ) : string
return string
    public function saveXml($formatted = false)
    {
        // Return a complete document including XML prologue.
        $doc = new DOMDocument($this->_element->ownerDocument->version, $this->_element->ownerDocument->actualEncoding);
        $doc->formatOutput = $formatted;
        $doc->appendChild($doc->importNode($this->_element, true));
        return $doc->saveXML();
    }