function sitemapEntryToXmlString(entries) {
  const xml = `<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">` + entries.map((entry) => {
    const url = `<loc>${entry.url}</loc>`;
    const lastModified = entry.lastModified ? `<lastmod>${entry.lastModified instanceof Date ? entry.lastModified.toISOString() : entry.lastModified}</lastmod>` : "";
    const changeFrequency = entry.changeFrequency ? `<changefreq>${entry.changeFrequency}</changefreq>` : "";
    const priority = entry.priority !== void 0 ? `<priority>${entry.priority}</priority>` : "";
    return `<url>${url}${lastModified}${changeFrequency}${priority}</url>`;
  }).join("") + `</urlset>`;
  return xml;
}

export { sitemapEntryToXmlString };
