Flexeril (cyclobenzaprine) and Xanax (alprazolam) are used as adjuncts to rest and physical therapy for relief of muscle spasm. Xanax is mainly used as an anti-anxiety medication prescribed to treat panic attacks and anxiety disorders. Flexeril and Xanax belong to different drug classes.