Serializes classes to xml and back