I did write the plugin to make things easy and finally you believe it's more complex with Polylang than with other plugins :(
Well I propose that we work in two times, first with the default permalink structure and second with url rewriting.
The 'language' is a custom taxonomy in Polylang, so I guess that the correct way to get your sitemap in the right language is to look for: my-site/?feed=sitemap&lang=fr
I made tests:
my-site/?feed=sitemap&lang=fr is broken except if I set it as the default language in Polylang (don't understand why yet).
However, I started debugging. Polylang does not modify the query (it sometimes do in some cases, but not here) and the program leaves my 'wp' filter with all posts and pages in the right language (whatever the language, whatever the choice for the default language). Up to here everything works as it should. Here is the SQL query:
SELECT wptest_posts.* FROM wptest_posts INNER JOIN wptest_term_relationships ON (wptest_posts.ID = wptest_term_relationships.object_id) WHERE 1=1 AND ( wptest_term_relationships.term_taxonomy_id IN (4) ) AND wptest_posts.post_type IN ('post', 'page', 'attachment') AND (wptest_posts.post_status = 'publish' OR wptest_posts.post_author = 1 AND wptest_posts.post_status = 'private') GROUP BY wptest_posts.ID ORDER BY wptest_posts.post_modified DESC
Here the language comes from: the term_taxonomy_id IN (4)
So something breaks after may wp filter. I will go on debugging this...
So I guess that when everything will work as expected, knowing the language of a post will not be useful. However there is a method: $polylang->get_post_language($post_id) returns the complete language object (in fact a term object). $polylang is global.