Well, no. Habit forming can happen with anything, including chocolate chip cookies. Xanax is an addictive drug if you take it every day, which you are doing. If you only take it as needed, meaning occasionally when anxiety is bad, it is probably not addictive, but can still be very hard to stop taking. Trazadone is an antidepressant, but it is so sedating it's not used as much as other SSRIs for anxiety or depression but is used for that unwanted side effect to help people sleep. But again, all these meds are very difficult to stop taking, and have to be tapered off of as slowly as you need to once you're on them, so it's worse than just habit forming. A habit you can just stop with enough will power, though it is very hard, but you don't suffer withdrawal from doing it. You can with these medications, so it's quite a different issue. The problem with taking any medication every day to help you sleep is it can make it harder to sleep over time, something called rebound insomnia. So it's best to exhaust all other options before taking medication. As you say your anxiety isn't so bad you can't cope but have this sleep problem, I would recommend trying the therapy first. Make sure your therapist is a psychologist who specializes in the treatment of anxiety, as not all of them do. It won't work as quickly as medication, but if it works, your problem will be solved. I'd ask, when this started, did something happen in your life that might have triggered this? Now, I won't give an absolute opinion on your medication. If you do need meds, you should see a psychiatrist, but meds are funny things. It's not that easy to find one that works for you and doesn't have a lot of side effects. Sometimes for some people benzos, despite being addictive, are the best things and the only things that work for them. I've had better luck with antidepressants, because they work all the time once they've been in your system for a sufficient period of time, whereas benzos wear off not that long after taking them. But whether or not something is officially called addictive, they can be very hard to stop taking, even sleeping pills. There are many natural remedies that help some people with sleep. Melatonin is one of the better known, but there are many herbs that are very mild and help some people. So there are substances and ways of coping out there that don't involve medication if you're willing to try them knowing it might take some time and experimentation to see results. Meditation and exercise and relaxation exercises an anxiety therapist can teach you or show you where to learn can also help. I'm afraid it isn't simple. I wish it were. Peace.
My opinion is that your doctor is probably right. I'm sorry. I know this means you will have to readjust which is hard and it may mean a brief disruption to your sleep issues. Is there anything else you can use as a temporary aid? But Xanax does become addictive and we can develop tolerance to it. It's a slippery slope to take it long term. A lot of people do successfully use trazadone for sleep. Trazadone is considered non habit forming but you'll need to decrease your dose if you discontinue it slowly. You've had two doctors give you the same advice.