Xanax is a medication used to treat anxiety and panic disorders, as well as posttraumatic stress disorder (PTSD). It\'s classified as a benzodiazepine, which also goes by names like alprazolam, diazepam and meperidine. Xanax is a medication used to treat anxiety and panic disorders, as well as posttraumatic stress disorder (PTSD). It\'s classified as a benzodiazepine, which also goes by names like alprazolam, diazepam and meperidine.