Thanks Kirk, any pointers on how to do custom sort?
I ended up exporting all files to XML and wrote a parser to read the XML, but the XML format isn't helpful at all. Key and Value are not connected to each other, so they just go by order (the value next to the key). I wish they were a simple Map of name - value pairs and maintain their relationship.
Custom sort sounds better.