Xanax will definitely take the edge off your withdrawals in the short term, but ultimately you need to look at your long-term options. It's not fun going through withdrawals, getting better, then getting worse over and over again, and it is absolutely possible to stop using altogether if that's what you actually want to do. I'm curious to know - did you only stop using because your source was unavailable? Or are you actually at the point where you've had enough? Either is fine and there's no judgement here, and sorry if I sound blunt or anything. That's unintentional and my questions are coming from the right place. I'm just trying to be direct with you.
If you do want to stop altogether you need to develop a long-term strategy to achieve this. Some suggestions are things like Narcotics Anonymous (not for everyone but I know a lot of people who are clean because of it, and it definitely works), drug and alcohol counselling, maybe even a long term rehab. You mentioned that you're working with a social worker which is great, perhaps you should discuss your options with them.
If however you're happier to continue using and moderate your use my suggestion is to try it, by all means. If you find yourself back in the same position again then what you need to do will become clearer to you. If you don't then happy days and let the good times roll.