Under Apex domains and
www subdomains it says
If you’re using external DNS, we strongly recommend setting the
www subdomain (or another subdomain) as your primary domain .
It doesn’t NOT say you have to use
www. When setting a custom domain to my Netlify site (prior to configuring my domains in Netlify DNS), I used the apex and my primary domain because that is what I had done for some time previously and found no issues with it. (I now use Netlify DNS for any site hosted here.)
You should, I believe, set the URL in the sitemap to whatever the content is served from. If the apex redirects to the
www subdomain, set the URL to the
www, or vice versa.