Made the xml deserializer more DRY