I have glanced at the responses and while it very possibly could be a medical problem and something that you might want to have looked at, I am also wondering if it is behavioral. The fact that she doesn't do it at school does suggest some control over things. My thoughts are to stay non-reactive and calmly empathize with her that that must feel pretty yucky, but then she needs to clean up whatever is made messy by wetting herself. Teach her to use the washing machine and dryer and do her own laundry associated with the clean up and if she needs to clean upholstery or carpeting, show her how the first time and then it should be her responsibility from there on out. I am wondering if the clean up and the attention that comes from that is what she is wanting. Provide attention in other positive manners. And ask her when she has an accident free day, how does that make her feel and celebrate that with her.
I know that when my own daughter kept wetting the bed at night, she quickly stopped once it became her responsibility to clean up her bedding and remake her bed at 2am by herself.