Cleaning up the XML serializer
Closes #182