HATA
XML ayrıştırma hatası: XML veya metin deklarasyonu varlığın başlangıcında değil NASIL ÇÖZERİM

XML ayrıştırma hatası: XML veya metin deklarasyonu varlığın başlangıcında değil
Konum: https://www.alomatba.com/sitemap.php
Satır: 2, Sütun: 1:
<?xml version="1.0" encoding="UTF-8" ?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">


<?php header('Content-type: Application/xml; chatset="utf-8"', true); ?>
<?php echo '<?xml version="1.0" encoding="UTF-8" ?>'; ?>
<urlset xmlns="http://www.google.com/schemas/sitemap/0.84" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.google.com/schemas/sitemap/0.84 http://www.google.com/schemas/sitemap/0.84/sitemap.xsd">

<?php require_once('ayar_.php');

$query = $db->prepare("SELECT * FROM kategoriler");
$query->execute();
$data = $query->fetchAll(PDO::FETCH_ASSOC);
foreach($data as $dt){
echo '<url>';
echo '<loc>https://'.$_SERVER['SERVER_NAME'].'/'.$dt['seo_link'].'</loc>';
echo '<lastmod>'.date('Y').'-'.date('m').'-'.date('d').'T'.date('H:I:S').'00:00</lastmod>';
echo '<changefreq>weekly</changefreq>';
echo '</url>';}?>
</urlset>
^