Hello, everyone, I'm trying to create an xml, but it returns the error of the title, I searched google and everything I saw about that was missing root, however, I believe I'm using root, can you help me?
$valorReal = 340.00;
$dom = new DomDocument("1.0", "ISO-8859-1");
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$root = $dom->createElement("AUTORIZACAO");
$total = $dom->createElement("TOTAL", $valorReal);
$root->appendChild($total);
$dom->appendChild($root);
header("Content-Type: text/xml");
echo "<xmp>" . $dom->saveXML() . "</xmp>";
Edit: Other suggestions for creating an xml also suit me:)