I wrote a script that can do that, and can be run on any platform with Ruby. It currently only processes listsoftware xml files. Could adapt it easily to a different xml structure. Not sure what xml file you have. See mamesoftwareparser in my sig for github link.