heres mine, years old, but it may give you a start
<?PHP
header("Content-Type: text/xml");
$page_content ='<?xml version="1.0" encoding="UTF-8" ?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
<title>The Eldritch Dark Recent Additions</title>
<description>The Last 10 additions to The Eldritch Dark</description>
<link>http://www.eldritchdark.com</link>';
include('sql_additions.php');
$result=sql_additions(30,10);
while ($row = mysql_fetch_assoc($result)) {
$page_content .='<item><title>'.htmlspecialchars($row['title']).'</title><dc:creator>'.$row['Fname'].'</dc:creator><description>';
$page_content .= htmlspecialchars(strip_tags($row['body_sub']));
$page_content .='</description><link>http://www.eldritchdark.com/'.$row['url'].'/'.$row['id'].'</link>';
$page_content .='<guid isPermaLink="true">http://www.eldritchdark.com/'.$row['url'].'/'.$row['id'].'</guid>';
$page_content .='<pubDate>'.date("r",strtotime($row['date_added'])).'</pubDate></item>';
}
$page_content.='</channel></rss>';
echo $page_content;
exit;
?>