I also have URLs which are 301-redirected, using PHP. The redirects happen successfully, so I am reasonably sure my PHP is OK.
However, the non-redirected URL appears in the sitemap xml and the one it is redirected to does not. Obviously this will be unsatisfactory for google.
Can you give me any pointers as to how to fix this please?