Dear miss_understood,
Valium, or diazepam, is a long acting benzodiazepine while Xanax, or alprazolam, is short acting. The time of onset for Xanax is quicker than that of valium which could be the reason why you find the induction of sleep to be longer when you take Valium. Although they are both given for sleep purposes (amongst other things) Xanax is more effective in the short run. However, with prolonged use of any benzodiazepine, the effectiveness decreases over time which could compound the reason why the switch from Xanax to Valium after a period of use could result in a perceived decreased effectiveness of Valium. I would suggest speaking to your doctor about this. One solution could be alternating between a benzodiazepine and another class of medication for your sleep issues; but remember that sudden ceasation of benzodiazepines could result in withdrawal symptoms. Of course, addressing the underlying reason why you have sleep issues should be the primary goal of care.
Hope this helps!