Please ask before you do it not after! Combining opioids and benzos is very risky. We can't know for sure if you're going to be ok - everyone is different. If you only use heroin once in a while it can be especially dangerous to add Xanax on top of it, even if you do take Xanax often. However, if you have a tolerance to Xanax and are used to taking it every day, didn't take any more than usual, and took the Xanax a few hours after the heroin, those things will at least have lowered your risk a lot. But please avoid this in the future, or if you are going to do it anyway take a lot less of each drug than you would normally do.
Exactly how much time after the heroin did you take the Xanax?
How long has it been since you took each drug?
How are you feeling now?
Are you alone?
If you are in doubt at least get a friend to hang out with you for a few hours so in case you pass out/stop breathing someone will at least be there to call an ambulance.