Medication can certainly be helpfull in quelling any symptoms of anxiety that might interfere with getting a good nights sleep on the evening before the exam; however, you should really stay away from taking those fast acting benzodiazapines. Xanax, Ativan and Valium are some of the most addictive drugs on the market. It has been reported that many people who take these medications often experience an increase in their baseline anxiety level after the effect of the drug wears off; thus, taking the medication starts a vicious circle which may ultimately lead to physical and psychological dependence. Furthermore, if you come down from the effects of any one of the aforementioned drugs durring the exam, it is most unlikely that you will perform at your highest level, and you might just have a full flown panic attack if things start to go awry. The reason why you were "way too nervous" durring the test was probably because you were coming off the Xanax. Talk to your doctor about non-benzodiazapine sleep aids, such as Ambien, or lower level Benzodiazapines such as Klonopin. Either one of these medications should be able to allow you to relax enough to get some sleep without producing that awful overly anxious rebound effect that those stronger benzodiazapines are reknown for. Good Luck.