Hi I was getting duplicate links, looked in the data base for my node loc and I could see two the same, I had seen that the code starting on line 222 if ($link_url == $last_url) { checks to see if the previous is the same, but my links were not in the right order, so I changed the sql

FROM

ORDER BY x.language, x.loc

TO

ORDER BY x.loc, x.language

This works for me but not sure if it would affect multi language sitemaps