The urlset
element and its descendants in your example XML document are all in the http://www.sitemaps.org/schemas/sitemap/0.9
namespace, so in order to match them with XPath expressions you must bind a prefix to that namespace and use it consistently:
<?xml version="1.0" encoding="UTF-8"?>
<html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sm="http://www.sitemaps.org/schemas/sitemap/0.9">
<body style="font-family:Arial;font-size:12pt;background-color:#EEEEEE">
<xsl:for-each select="sm:urlset/sm:url">
<div style="background-color:teal;color:white;padding:4px">
<span style="font-weight:bold"><xsl:value-of select="sm:loc"/></span>
</div>
<div style="margin-left:20px;margin-bottom:1em;font-size:10pt">
<span>Last Modified:<xsl:value-of select="sm:lastmod"/></span>
</div>
</xsl:for-each>
</body>
</html>
In XSLT/XPath 1.0, unprefixed element names always mean elements in no namespace, and prefixed names take the namespace bindings from the stylesheet, not from the input XML.
As an aside, if you're writing XSLT to be interpreted on the client side by browsers then you will be restricted to XSLT 1.0, so I suggest you find a good 1.0-specific tutorial and reference guide. The material on w3schools isn't always clear about what version of XSLT/XPath it refers to and you'll get frustrated if you keep trying things that don't work, only to find they're 2.0-only constructs...