Convert it to a dataset first, and then you can use WriteXML to dump it without having to loop through the rows.