Don't worry, a xanax isn't going to mask a real medical problem. If it helped, it definitely suggests that the problem is anxiety, and not a heart problem (or something else)!
Sometimes it's easier to think it's a real medical problem, because those can be "easier" to deal with. (i know it doesn't make much sense on the outside, because cancer isn't easy to deal with, but it's got a concrete treatment, while anxiety is psychological, and isn't as concrete.)