I've been attempting to follow the tutorial here: http://www.tonymarston.net/php-mysql/dom.html in order to convert a MySQL query to XML using PHP and I'm having two issues:First, all I'm getting is a huge string of the results of my MySQL query with no XML elements whatsoever and definitely not properly formatted in the XML format. I was able to determine this by simply outputting the string to my browser. I'm attempting to use the DOM extension within PHP, which I know is enabled in my PHP installation as I checked that already using \[code\]phpinfo();\[/code\].Secondly, I'm getting a '\[code\]Call to undefined method stdClass::save()\[/code\]' error on the last line where I attempt to save the document. I'm stumped as to why I'm getting this error and Googling for the answer has really been unhelpful.Here's the code I'm using:\[code\]function createParkNameXML(){ $table_id = 'parks'; $result = mysql_query("SELECT name FROM $table_id"); // create a new XML document $doc = new DOMDocument('1.0', 'UTF-8'); // create root node $root = $doc->createElement('all_parks'); $root = $doc->appendChild($root); // process one row at a time while($row = mysql_fetch_assoc($result)) { // add node for each row $occ = $doc->createElement($table_id); $occ = $root->appendChild($occ); // add a child node for each field foreach ($row as $fieldname => $fieldvalue) { $child = $doc->createElement($fieldname); $child = $occ->appendChild($child); $value = http://stackoverflow.com/questions/12698758/$doc->createTextNode($fieldvalue); $value = $child->appendChild($value); } } $dom->formatOutput = true; // get completed xml document $dom->save('parks.xml'); //$xml_string = $doc->saveXML(); //echo $xml_string;}\[/code\]Thanks for any insights you can provide!