correctly iterate xml fields