Xanax is also used to treat panic disorders with or without a fear of places and situations that might cause panic, helplessness, or embarrassment that is agoraphobia. When this medication is used for a long time, it may not work as well. Talk with your doctor if this medication stops working well.