#529 cleanup XML before saving into dynamo