I was on Temazepam for a couple of months, started off at 7.5mg and slowly worked my way up to 30mg as needed. The thing with Alprazolam (Xanax) is that it is quick acting. The Xanax will help you fall asleep more easily than anything, I'm prescribed 2mg bars to take once daily for anxiety, and I end up taking a nap a majority of the time. The Temazepam is made to specifically combat insomnia, so not only should it help you fall asleep but it should help you stay asleep longer as well.
Just be careful using benzodiazepines for sleep. With daily, consistent use of benzos, your receptors are going to wear out easier, making the withdrawals from them stretch out over time. Why jump straight into benzos though? Have you tried any other medications that don't necessarily have to be prescribed, such as OTC Melatonin? If benzos seem to be the only option, just make sure you aren't relying on them every night to fall asleep. Your receptors will be gracious for the few days break in between. I wish you the best of luck, coming from someone who also suffers from insomnia as well.
P.S; If insomnia is too bad, medications can be prescribed together to combat not sleeping if monitered very closely. For example, someone can be on Ambien as well as Trazodone for sleep. You have a variety of options.