Fixed reading/writing XML

Fixed reading/writing XML using reflection. I have one thing I don't
like where I am using 2 try-catch blocks, but I don't know how to get
around it yet. I've moved all the code for reading XML into each
respective class.