<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:url="http://www.sitemaps.org/schemas/sitemap/0.9">
  <xsl:output method="html" encoding="UTF-8" indent="yes" />

  <xsl:template match="/">
    <html lang="en">
      <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>XML Sitemap</title>
        <style>
          body {
            font-family: Arial, sans-serif;
            margin: 2rem;
            color: #222;
            background: #fafafa;
          }
          h1 {
            margin-bottom: 0.25rem;
          }
          p {
            color: #666;
            margin-top: 0;
          }
          table {
            width: 100%;
            border-collapse: collapse;
            background: #fff;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
          }
          th,
          td {
            border: 1px solid #e5e5e5;
            padding: 12px;
            text-align: left;
          }
          th {
            background: #f4f4f4;
          }
          a {
            color: #0b5fff;
            text-decoration: none;
          }
          a:hover {
            text-decoration: underline;
          }
        </style>
      </head>
      <body>
        <h1>XML Sitemap</h1>
        <p>Click any link below to open the page.</p>
        <table>
          <tr>
            <th>Page</th>
            <th>Last Modified</th>
            <th>Change Frequency</th>
            <th>Priority</th>
          </tr>
          <xsl:for-each select="url:urlset/url:url">
            <tr>
              <td>
                <a href="{url:loc}">
                  <xsl:value-of select="url:loc" />
                </a>
              </td>
              <td><xsl:value-of select="url:lastmod" /></td>
              <td><xsl:value-of select="url:changefreq" /></td>
              <td><xsl:value-of select="url:priority" /></td>
            </tr>
          </xsl:for-each>
        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
