I\'m using this code in Codeigniter to generate XML:
public function get_cuisine()
{
$this->load->dbutil();
$sql = \"select * from cuisine\";
I had also the same question. I have googled it. Found this solution. And it works perfectly for me. Click here to get the source code
Just download and unzip ( extract it)
Then copy the xml_writer.php in application->libraries of the extracted folder to your libraries folder in your Codeigniter project.
Also copy the xml.php in the application->controller in to your controllers folder
Finally copy the xml.php in the views of the extracted folder in to your view and run it..
That's it...