Creating the XML is the easy part. The tricky part is retreiving the correct data from the database at the correct time. If you know the XML structure and know exactly what data is needed then there should be no problem.
Example for simplicities sake. I want to create some XML from my imaginary database.
<mystuff>
<stuff id="1">
<title>This is the title</title>
<desc>Ths is the description</desc>
</stuff>
<stuff id="2">
....
</stuff>
</mystuff>
$result = mysql_query("SELECT t1.id, t2.description, t3.desc
FROM stuff as t1, titles as t2, descriptions as t3
WHERE t1.id = $id AND t2.tbl1_id = t1.id AND t3.tbl1_id = t1.id");
$xmloutput = "<mystuff>";
while($row = mysql_fetch_assoc($result)){
$xmloutput .= "
\t<stuff id=".$row['id'].">
\t\t<title>".$row['title']."</title>
\t\t<desc>".$row['desc']."</desc>
\t</stuff>
";
}
$xmloutput .= "</mystuff>
hth in some way 🙂