Anxiety is a possibility you might want yo explore. My daughter is 10, and she has a very intense attachment to me. When she was little, I'd rock her to sleep or lay next to her until she was out. It's a comfort thing, I believe. A feeling of closeness and security. I had twins later, who are 4 now, and they require more of my time. It's difficult to lay with her every night and since I'm so tired, there's a good chance I'll fall asleep too. My poor husband! Anyway, I have some very prominent displays of anxiety, especially when it comes to loved ones' saftey, being away from my husband at night, and a general fear of things going wrong. Anxiety tends to be hereditary. My mother's side of the family has a long history of anxiety and depression. Whether it was inherited or learned, my daughter definitely has it. She calls me constantly when spending the night at friends' houses...just to see what we're doing and if we're okay. My twin boys are a worry point for her especially. She sometimes goes so far as to fake illness to come home. Nightmares about bad things happening to her and/or family members became common. The point of all of this is that when kids feel like they can't control their surroundings in a way that makes them feel secure and at ease, anxiety can rear its ugly head and cause problems later with relationships and overall confidence. There is something to be said about therapy. Specifically, a therapist who specializes in communicating with children. If it's too pricey, check with your child's school counselor for free or discounted counseling resources. It doesn't have to be a long term thing, but it helps. I promise. Medication is effective, but I consider it a last resort after therapy alone hasn't helped. Besides, meds are meant to help with the problem, not fix it. Sorry for the novel. I wish you both luck and restful nights--in your own respective beds.
Ugh, sounds hard. I know we can be our own worse enemies with the 'giving in' as you did early on which taught her that if she tries hard enough, you will do just that. Do you think she has anxiety? Does she seem anxious in other parts of her life? If that is the case, then you should speak to her doctor about it for help. Otherwise, I'd wait until she has a break from school and do two things--- first, go on a shopping and redecorating spree with her. Redo her room to her liking. A 'big girl' room with maybe a bigger bed (if she still has a twin), new wall color, curtains, bed covering, etc. And a good low light to leave on all night. make it fun and exciting to do this for her! Then have a heart to heart. That she is okay at night and that learning to sleep alone is really part of growing up. That she knows nothing will happen at night and that everyone needs a good night sleep including you. So, you will start a new night time routine and then she must stay in her room. And then STICK to it. That's why I say do it when she has a break so that if there are some really long nights of her 'hyperventilating' and carrying on without you giving in, she doesn't have to get through a school day. Or heck, she's old enough that if she does this and has a horrible day because she is exhausted, maybe she will give up quicker/easier.
You can try a pet also as stated above--- but I think she also needs to learn that she is okay and can sleep on her own. You're not going to college with her, right? These are lessons most kids go through much younger but that doesn't mean she shouldn't go through it now. It's hard on us because we second guess ourselves but I think you can resolve this with some serious commitment to it.
good luck
She might feel less frightened at night if she has a pet to sleep with. You could possibly get one specifically to sleep with her -- could she handle sleeping with small dog or a cat? She would have to learn to be appealing to the pet, though, or the pet will not want to be there.