<?xml version="1.0" encoding="UTF-8"?>
<urlset
        xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:xhtml="http://www.w3.org/1999/xhtml"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
        http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
    {% for url in urls %}
        <url>
            {% if url.loc|replace({hostname:''}) == url.loc %}
                <loc>{{ hostname }}{{ url.loc }}</loc>
            {% else %}
                <loc>{{ url.loc }}</loc>
            {% endif %}
            {% if url.lastmod is defined %}
                <lastmod>{{ url.lastmod }}</lastmod>
            {% endif %}
            {% if url.changefreq is defined %}
                <changefreq>{{ url.changefreq }}</changefreq>
            {% endif %}
            {% if url.priority is defined %}
                <priority>{{ url.priority }}</priority>
            {% endif %}
        </url>
    {% endfor %}
</urlset>