I think you need to see a doctor. I have never heard of a 6 year old getting UTIs before (usually that happens to teenaged and adult girls once they become sexually active, it's very sex-related...) It is interesting that elimination of gluten helps, maybe her BMs are less messy and it doesn't get into her UT?
But really, I'd see a doc. It COULD be food-related, but it could also be other things. For instance, maybe she can't feel that she's doing it. I don't know. A healthy diet solves a lot of problems, yes, but it sounds like you're feeding them a pretty healthy diet. If I were to give one dietary suggestion, though, I'd try the no dairy. Lots of kids are lactose-intolerant, and it could be that she just can't, erm, 'hold it in.'
Stumbled into Primal due to food allergies, and subsequent elimination of non-primal foods.
Start Gluten-Free/Soy-Free: December 2012; start weight 158lbs, Ladies size 6
Start Primal: March 2013, start weight 150lbs, Ladies size 6
Current: 132lbs, Ladies size 2
26lbs lost since cutting the crap.