<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

header("Content-Type: application/xml; charset=UTF-8");

$pages = [
    "index.html",
    "itam.html"
];

echo '<?xml version="1.0" encoding="UTF-8"?>';
?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

<?php
foreach ($pages as $page) {

    if (file_exists($page)) {
        $lastModified = filemtime($page);
    } else {
        $lastModified = time(); 
    }
?>
    <url>
        <loc>https://serviceflx.com/<?php echo htmlspecialchars($page); ?></loc>
        <lastmod><?php echo date('c', $lastModified); ?></lastmod>
        <changefreq>hourly</changefreq>
        <priority>0.8</priority>
    </url>
<?php } ?>

</urlset>