I was musing on how to help someone rearrange the genres in iTunes. The data is stored in one great big XML file, so going through it by hand with a text editor would be annoying. If I were doing it myself, I'd just write a quick XSLT script to do the work. But that would involve knowing all the strings in advance and having access to the XML. I could write one script to emit all the unique genre tags, and then have a second script to apply them. But editing big complicated XSLT scripts isn't for the faint-hearted either (an XSLT script is just a big ugly XML file, you see). Well, I could write an XSLT script that takes an XML description and generates the desired XSLT script automatically. And I could make it generic, so the (small, rational to edit) XML configuration file could specify things like:
<replace what="genre" from="rock alternative" to="alternative">
That way, it could fix genres, album names, whatever. But realistically, it would be (much) easier to just offer to fix the iTunes XML myself.