Oh goodness, almost, what a worry for you. :( Are you okay? Must be difficult to cope with.
It's quite odd reading this thread because I was very much like this at your daughter's age. From ages 5-12 I think I spent every single night in my bed, unable to sleep, thinking what would happen if my mother died. :(
I also got very very upset if I couldn't complete school work, as if I was failing myself and my family. I was over-sensitive to everything, and just worried. About everything. I had more phobias than normal, too.
My son (now 7) is a worrier, like me. He has had a few nights where he thinks horrible things, mostly about how rubbish he is at school and how all his friends are cooler than him (when in fact, of course, he's lovely and cooler than the Fonz!)
We have devised a trick for him, and thus far, it has worked. He has a memory bank of Good Thoughts. They can be memories of good or happy times, or fantasies of things that will happen in the future. DS likes to think of the massive house he'll have when he's a man :o and when his mind turns to sad/bad things, he makes himself walk through the house, choosing where the TV goes/ what food that will be in the fridge/ what pets he'll have. If the house one doesn't work, he thinks of what will happen in the movie he'll write when he's a man. Or what he wants to put on his Christmas list.
It's a technique that takes a bit of time to perfect, but it worked for me as a child, and it seems to work for my son too.
Good luck. :)