I've seen many people complaining about this error, but they all seem to know what the URL is. For example, one reporter said that Google was complaining about URLs which weren't in their sitemap at all. (That problem went away on its own.)
In my case, however, Google isn't telling me what the problem is. "This URL is not allowed for a Sitemap at this location" it tells me. Which URL? I don't know. It doesn't say.
Since the sitemap is XML generated by the SimpleXML PHP extension, it's all on Line 2, so that doesn't help. And the URLs given all match the domain of the site.