Welcome to Healthcare Magic
Does she have any problem passing urine or stools. Any blood in urine or burning sensation on passing urine. She could be getting on and off muscle spasms due to probable local irritation of nerves. It is best she gets a consult with her Paediatrician and the cause found out and treated. If it is just muscle spasms there are muscle relaxants which will help but the pathology as to why it is happening also needs to be found out. She may require scans and urine test to rule out renal stones
as well. Let her drink enough water, get enough exercise, eat plenty of fresh fruits and green leafy vegetables.