<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
        xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
    {% for url in urls %}
    <url>
        <loc>{{ url.loc }}</loc>
        {% if url.changefreq is defined %}<changefreq>{{ url.changefreq }}</changefreq>{% endif %}
        {% if url.priority is defined %}<priority>{{ url.priority }}</priority>{% endif %}
        {% if url.lastmod is defined %}<lastmod>{{ url.lastmod }}</lastmod>{% endif %}
        {% if url.images is defined %}
        {% for image in url.images %}
        <image:image>
            <image:loc>{{ image.loc }}</image:loc>
            {% if image.title is defined %}<image:title>{{ image.title }}</image:title>{% endif %}
            {% if image.caption is defined %}<image:caption>{{ image.caption }}</image:caption>{% endif %}
        </image:image>
        {% endfor %}
        {% endif %}
        {% if url.videos is defined %}
        {% for video in url.videos %}
        <video:video>
            <video:thumbnail_loc>{{ video.thumbnail }}</video:thumbnail_loc>
            <video:title>{{ video.title }}</video:title>
            <video:description>{{ video.description }}</video:description>
            {% if video.content_loc is defined %}<video:content_loc>{{ video.content_loc }}</video:content_loc>{% endif %}
            {% if video.player_loc is defined %}<video:player_loc>{{ video.player_loc }}</video:player_loc>{% endif %}
            {% if video.duration is defined %}<video:duration>{{ video.duration }}</video:duration>{% endif %}
        </video:video>
        {% endfor %}
        {% endif %}
    </url>
    {% endfor %}
</urlset>
