Let me preface my response... I think we should de-regulate just about every natural and synthesized "medication". This will be more beneficial to society, allowing Darwin's theory to sort it out.
First the question should be why are you prescribe the ambien? Do you have an issue falling asleep or staying asleep? Typically ambien is prescribed to get the patient to fall asleep (mind racing/wandering, ADHD patients, and restless leg syndrome patients) however if you cannot stay asleep, ambien may be a poor solution. The Xanax and ambien mixture is dangerous in higher titrations. However Xanax does build up in your system (like marijuana) and eventually will require higher doses to maintain the same effect.
Also, it's important to know what type of doctor prescribed the medications, Were you were open and honest with he/she on you real drug intake.
If you don't suffer from anxiety when you sleep, only take the ambien and discuss a different dosage of the Xanax.
Completely fictional, Call your Doctor! They didn't go to school for 8-10 years to lie to you...