I have finally solved this, I posted the answer on stackoverlow, I'll link to there it here because then I have one place to update.
The answer:
[stackoverflow.com/questions/68622198/how-to-extract-relation-members-from-osm-xml-files][1]
[1]: https://stackoverflow.com/questions/68622198/how-to-extract-relation-members-from-osm-xml-files
I have finally solved this, I posted the answer on stackoverlow, I'll link to there because then I have one place to update.
The answer:
[stackoverflow.com/questions/68622198/how-to-extract-relation-members-from-osm-xml-files][1]
[1]: https://stackoverflow.com/questions/68622198/how-to-extract-relation-members-from-osm-xml-files