If you have no heart problems, you're probably magnesium deficient, as are about 80% of the population. I am myself. I have been taking magnesium citrate tablets for about 4 years for palpitations, however, recently they seem not to work as well. Found out that mag citrate is not the best form of magnesium to take, magnesium orotate gives you much more mag in your body..have ordered some. There are other forms of mag available...look up on the internet. Also the powder form of mag that you mix with water seems to help more than tablets. I was on Coumadin for about 6 months, hate that drug, so decided I wanted to be off it. Searched for a substitute for it, couldn't find one, but DID find that the reason I was having arrhythmia, palpitations was because I was mag deficient..did have all kinds of heart tests including EKGs, stress test, echo, had Holter monitor twice, saw cardiologist...nothing wrong with my heart. No one even mentioned magnesium to me, better off doctoring myself, conventional doctors don't know anything about supplements or vitamins or how to keep you healthy, all they do is keep you on drugs that cause even more problems.
I know that while xanax will not resolve a heart issue, it does relieve anxiety...and many times panic attacks and anxiety brings on palpitations and skipped beats. I took xanax for a few months in 2005 after I had a SVT episode and I thought my world was crumbling. I was having rapid beats (not SVT) skip beats and palpitations that was related to anxiety. Xanax did absolute nothing for my SVT....so I can say with great certainty xanax will not resolve a heart problem.
I believe that your pounding heart has to do with anxiety, but if it continues you might want to see a cardio doc to confirm.
How long have you been on xanax and how much do you take a day? Have you started to ween off of them....because stopping xanax will cause withdrawls like what you are describing.....
Deep slow breathing helps so much with anxiety. I have a few things that I did that really helped me a couple of years ago....Let me know if your interested.
Good Luck,
Rose