Switch to XML rather than random text files

There are a couple of things I could probably do better, but at the moment, it works and I think the files are stored a bit better.