I have not enough reputation to add a comment, so I need to post a new answer.
The solution vonof "John Rix" works perfect but I like add one thing: You have to make sure you sort the data from the xml file by version number. It is not sufficient to use the last occurrence of downloadurl because the list seams to be unsorted.
Example: https://update.joomla.org/language/details3/de-DE_details.xml 3.9.15.1 is positioned prior to 3.9.9.1 which is currently the last entry in the xml.