src/ApiProblem.php
public function asXml(bool $pretty = false)
    {
        $doc = new \SimpleXMLElement('<problem></problem>');

        $this->arrayToXml($this->compile(), $doc);

        $dom = dom_import_simplexml($doc);
        if ($pretty) {
            $dom->ownerDocument->preserveWhiteSpace = false;
            $dom->ownerDocument->formatOutput = true;
        }
        return $dom->ownerDocument->saveXML();
    }
public function asXml(bool $pretty = false)
    {
        $doc = new \SimpleXMLElement('<problem></problem>');

        $this->arrayToXml($this->compile(), $doc);

        $dom = dom_import_simplexml($doc);
        if ($pretty) {
            $dom->ownerDocument->preserveWhiteSpace = false;
            $dom->ownerDocument->formatOutput = true;
        }
        return $dom->ownerDocument->saveXML();
    }
public function asXml ( bool $ pretty = false ) { $ doc = new \ SimpleXMLElement ( '<problem></problem>' ) ; $ this -> arrayToXml ( $ this -> compile ( ) , $ doc ) ; $ dom = dom_import_simplexml ( $ doc ) ; if ( $ pretty ) { $ dom -> ownerDocument -> preserveWhiteSpace = false ; $ dom -> ownerDocument -> formatOutput = true ; } return $ dom -> ownerDocument -> saveXML ( ) ; }
Renders this problem as XML.

@param bool $pretty
Whether or not to pretty-print the XML string for easier debugging.
@return string
An XML string representing this problem.
Renders this problem as XML .