", $ar);
        } else {
            $content = implode("</sitemap>", $ar);
        }
    }

    header('Content-Type: text/xml; charset=utf-8');
    echo $content;
} else {
    $file_404 = $_SERVER['DOCUMENT_ROOT'] . '/404.php';
    if (file_exists($file_404)) {
        include($file_404);
    } else {
        header("HTTP/1.0 404 Not Found");
        echo "Страница не найдена";
    }
}
