As long as you are switching under the direction of your doctor. BOTH of these medications have a relatively short half life (Ativans is not much longer than xanax...in some cases it is SHORTER depending on how quickly you metabolize it). Both are prescribed for short term use and the lowest possible effective dose.
Be careful on taking the advice on this forum as fact when considering medications. None of us are qualified doctors or pharmacists while many of us have experiences with various forms of medication...just keep working with your doctor!
Assume you mean Ativan right? Xanax and Ativan are both benzodizepenes, anti-anxiety medications in the same class as Valium and Klonopin (which I take). All of them have different half lives (how long they last in the body) and the potential for a person to build up a tolerance to it depends on the half life. The half life of Ativan is short but much longer than that of Xanax which is really meant for occasional use for panic attacks. Ativan can more safely be taken everyday on a regular basis. I would assume unless one wasn't working that's why your psychiatrist changed you over but you should ask them as well to clarify.