I already have this code... same problem
Are you able to reproduce this?
And you have this xml fragment repeated in each section? CEX & DEX?
TBH, like DeViL303 I never use priority, I don't really see the point of it, at least not for the average user...
About your query regarding emu games sorting, there's only one way to sort your ROMs by categories or add appropriate information like the emu type under the game title, you must modify the wMM C code.
Whether in the standard games list or in Launchpad, wMM regularly recreates the corresponding xml files. How often the xml is recreated depends on the chosen wMM settings.
FYI
1. The changes to make in wMM source code to sort the games should be fairly small, the xml is built step by step in a loop processing each title found when scanning the folders.
In theory, if the emu type can easily be found, adding a couple of lines of code to detect it then tweak one existing line of code to modify the xml output would probably be sufficient to give you the result you are looking for. However....
2. a prx project like wMM does not have an unlimited amount of memory available for use.
Not so long ago, wMM couldn't list more than a few hundreds games without having memory problems among other things. Luckily, deank & Aldo both worked on their respective projects' C code to improve memory usage & performance.
But memory/resources limitations should still be considered seriously before making permanent changes to the sorting algorithm.
3. Emulator games were added to the wMM games list only a few months ago. Since then, Aldo has been focusing mainly on making the last builds stable (rightly so imo) rather than adding yet more features on top of a glitchy base leaving little time to consider new situations like yours with thousands of emulator game titles.