Append child to an existing XML file in Joomla! using API

Speandycreern

New Member
I am trying to add a new child to existing xml file in Joomla! 1.6 .\[code\]$db =& JFactory::getDBO(); $xml = JFactory::getXMLParser('Simple');if($xml->loadFile($xmlFile)) //the xmlFile is a valid file{ foreach( $xml->document->q as $q ) { $q->addChild('explanation'); $explanation = $q->getElementByPath('explanation'); $explanation->setData('This is some explanation'); }}else { return "Unable to load";}`\[/code\]Every thing is working file, My problem is how shall I save this new xml in the existing xml file.Thank you.
 
Back
Top