Sounds very typical of encopresis. In boys, it's mostly stool seeping out. In girls, it's mostly pee accidents because of the location of the bladder (the hard mass of stool inside the colon presses against the bladder in girls). Take her to a pediatric gastronentologist (think that's how it's spelled). She'll probably have to get an x-ray to see the extent of the impactation and then again after 'clean-out' to make sure it's really gone.
The standard treatment is to clean out the colon and get the hard mass out -- usually by lots of doses of Miralax for a few days. And then continueing with Miralax daily to help prevent the constipation. We've been dealign with this with my son for a few years so you might be in for the long haul if it's been going on for awhile.
Try to find out what causes the constipation and avoid common foods that cause it -- bananas, applesauce, white rice, white bread, etc. Increase the fiber - raisins, FiberOne bars (my son loves these), high fiber cereals (FiberOne has some tasty ones my kids love) and push lots and lots of water.
My son is very sensitive to dairy and for years has been limited to just 1-2 servings at most each day - often none. After school let out for the summer, we put him on a cassein-free diet (no milk/dairy at all, even in baked goods, etc) and we've seen a HUGE improvement in just a few weeks. He hasn't been constipated at all this summer and therefore hasn't had a soiling incident in 4 weeks (the longest he's gone in the past 6 years!). Going completely cassein-free is a big pain in the butt because milk is in so many things, but it's not too bad once if you ease into it. It's also easier these days to find many soy/coconut/almond-milk substitutes... he enjoys ice cream sandwiches, fudge pops, milkshakes, brownies, chocolate chip cookies, etc like the other kids.