OMG that was one of my biggest fears. A friend of mine had her son wake up and before she knew he was awake had smeared poo all over his cot and himself! This happened a few times. The poor thing was beside herself, and rightly so!
She started using bodysuits and clothes that were difficult for him to undo long enough to break the habit. I think also it would be really important to heap praise on her when she does good things, not just poo related because it could be an attention thing. I'm not saying you don't give her enough attention or anything like that but kids minds work in mysterious ways and she has learnt that she gets a good deal when she does this IYKWIM.
I'd also talk to her daycarers and ask how they talk to her, as they shouldn't say she was naughty for doing a poo in her nappy at all.
Good luck!