Nisam mislio na to, već na generisanu stranicu, ali hajde probaj ovako:
PHP kôd:
<?php
header("Content-type: text/xml");
$host = "localhost";
$user = "user";
$pass = "lozinka";
$database = "baza";
$linkID = mysql_connect($host, $user, $pass) or die("Could not connect to host.");
mysql_select_db($database, $linkID) or die("Could not find database.");
$query = "SELECT * FROM tabela";
$resultID = mysql_query($query, $linkID) or die("Data not found.");
$xml_output = '<' . '?' . 'xml version="1.0" ' . '?' . '>';
$xml_output .= "<entries>\n";
for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
$row = mysql_fetch_assoc($resultID);
$xml_output .= "\t<entry>\n";
$xml_output .= "\t\t<ID>" . $row['ID'] . "</ID>\n";
// Escaping illegal characters
$row['text'] = htmlspecialchars ($row['text']);
$xml_output .= "\t\t<text>" . $row['text'] . "</text>\n";
$xml_output .= "\t</entry>\n";
}
$xml_output .= "</entries>";
echo $xml_output;
?>