Xanax while pregnant

Tari
I am 32 and 10 weeks pregnant. All my doctors knew I was prescribed Xanax and have been for about 7 years. At my last appointment my doctor completely freaked me out about continuing to take them. I have had two miscarriages in the past year and would never do anything to hurt my child. PLEASE PLEASE HELP ME!! Does anyone know what the right thing to do is? It kinda caught me of guard because my Obgyn and physiatrist all knew we where ttc and never said anything now my Obgyn scared me to death. Please help me!!!