If it could be a kidney or urine infection loads to drink is the best thing, including any fresh fruit juice - cranberry is best but any juice helps, but lots of water is best. The wriggling around can be a sign of a kidney/bladder infection, typically people with any kind of kidney discomfort find it hard to sit still, no idea why, just one of these little facts I have picked up from my dh at some point!
If there is a chance it could be kidneys you should see the doc - kidney infections are unusual in children and can be the result of a structural problem with a little valve, and so need to be checked out (happened to my best friend's ds).
Hope she feels better soon.