cj gives good advice; benzos are for anxiety, not sleep. I would recommend you try melatonin or Calms Forte or some other natural remedy, or even a sleep center, before you do medication for sleep. But if you do decide on meds, at least use one that's designed to help you sleep like Ambien, not a benzo. And remember, all of them are habit forming and some are addictive if you use them regularly, so natural is a better way to try first; the medications will always be there if you need them.
Ambien is specifically designed to help you sleep while Xanax can help, it is prescribed for anxiety. Also, remember, that you can build a tolerance up with xanax...If you are still concerned, why not talk with your pharmacist that fills your prescription? They usually have a wealth of knowledge that you can tap into in my opinion. I have used it a couple of times and it worked...just ensure you have a fairly good chunk of time blocked off for sleep. Keep us posted!