Xanax contains alprozolam which is an benzodiazepine and is use to treat anxiety. All benzodiazepine can be tested for addiction. If some one has used for the treatment purpose then it can be tested positive for 3 days in urine and if someone has used it for long time like one year then his test can be positive for 4-6 weeks in urine. This drug can be found for 6-48 hours in blood and up to 90 days in hair follicles.
Xanax stays in the system for 14 days if only used once. If you use xanax daily, it can stay in the system up to 6 weeks.