<?php

header('Content-type: text/xml');

$domain = preg_replace('/^www\./', '', $_SERVER['HTTP_HOST']);
$file = 'include/' . $domain . '/_config.json';
$site = json_decode(file_get_contents($file), true);

echo '<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url><loc>http://www.' . $domain . '</loc><priority>1.0</priority></url>' . "\n";

while (list($link, $title) = each($site['menu'])) {
	echo '<url><loc>http://www.' . $domain . '/' . $link . '</loc><priority>0.5</priority></url>' . "\n";
}

echo '</urlset>';

?>