ok this happened to my DD. In the end I got her to sit on the potty to do poo in her nappy. Did this for a while, and then I slowly started to undo the nappy whilst she was sitting on the potty pooing in her nappy. Then just put the nappy in the bottom of the potty with a little bit of toilet paper on top. Then took the nappy away, and left the loo paper. All up it took a couple of weeks, but it worked and it wasn't stressful for her.
HTH. Let me know how you go!