I've used PowerShell to do similar things. From the 10,000ft view, you import an XML file directly into a variable, pull the values you need, and then Export-CSV it out.
Take a look at this blog entry (https://laurentschneider.com/wordpress/2014/11/xml-to-csv-in-powershell.html) and the top answer here (https://stackoverflow.com/questions/23409270/how-to-convert-this-xml-to-csv-using-powershell-2-0)