northpaw
My first thought is an allergy to something in her diet. Even though she's on a restrictive diet now, something in her diet might be wrong for her. I'd first look for the foods she seems most fond of and the ones she's most repelled by.
Second thought is severe anxiety or fear. She could literally be scared s***less. The Emotional Freedom Technique might help her relax about going potty. And it's easy enough for a child to learn.
The obvious questions are is she eating enough fiber and drinking enough water?
Finally, are you sure it's mucous and not strings of candida? Many people with candida are constipated.