Xanax (generic name alprazolam) is one of several different medications in the class of medications known as benzodiazepines. These medications are frequently used to treat anxiety disorders, and they also have some use in treating insomnia
, muscles spasms, and a few other conditions.
When used regularly, the benzodiazepines can definitely be addictive and create dependence. For this reason, it is not a good idea to use them regularly for treating insomnia without very close oversight from your primary care doctor
I would recommend that you go back to touch base with your doctor about this issue again. If you are continuing to have persistent trouble with sleep, and if you are requiring the Xanax more and more frequently, then figuring out the cause of your insomnia is absolutely essential.
Also, if you have undiagnosed or untreated anxiety, that is something that you should talk to your doctor about. There are other medications that are not habit forming that can be used in the treatment of anxiety, and therapy or counseling can also often be very effective.
I would recommend that you discuss all of these issues, both your insomnia and your anxiety, with either your primary care doctor or with a psychiatrist
, if you have one.