I've just spent the morning trying to find out why xmlsitemap is not taking the aliases generated by pathauto and putting them into the sitemap instead of /node/123

After trying a bunch of suggestions including changing the weights of modules, it's still doing the same thing except when I create new content, which shows the correct alias in the sitemap. The correct alias also appears if I click on the old content, click edit and click save.

Is there a SQL genius out there who knows what is going on here and can give me a SQL statement that I can run to correct the alias problem without having to go back and click on all the content?