Welcome to health care magic
I can understand your situation. I appreciate your effort to seek online support.
As per your description, there are few possibilities in this case-
1) Bipolar disease (current episode mania/hypomania
2) Agitated depression
is not known to cause such kind of behaviour.
Xanax contains alprazolam which is a sedative for insomnia
. However your wife needs detailed evaluation and she might need some more drugs like antidepressants/ mood stabilizers etc. Once primary disease is treated, her sleep problem will also be gone.
Don't worry and consult a qualified psychiatrist
Hope it helps
Dr. Gourav Monga