I agree with Silverfox.
My 8 year old grandson has the same from time to time.
It is all down to diet and going to the toilet when there is an urge and not to hold on and delay going.
More fruit, veg and fiber with plenty of fluid intake (preferably water) should sort her out. If she does not complain of pain when passing the stools and there is no blood visible on the stools, then I would not worry about it.
Sounds like she needs some plain yogurt with live culture. If she can't tolerate yogurt, try some Probiotics. This should help.