The CIR short rate model is $$dr_t=k(\theta-r_t)dt+\sigma\sqrt{r_t}dW_t$$ under the risk-neutral measure. The bond price is of the form $$P(t,T)=A(t,T)e^{-B(t,T)r_t}$$ where the continuously compounded spot rate is an affine function of the short rate $r_t$. My question is, how should Ito's Lemma be applied to find $dP(t,T)$?
Here is my attempt: $$\ln P(t,T)=\ln A(t,T)-B(t,T)r_t$$ $$d\ln P(t,T)=d\ln A(t,T)-r_tdB(t,T)-B(t,T)dr_t$$ $$(d\ln P(t,T))^2=B(t,T)^2\sigma^2r_tdt$$ \begin{align} d(e^{\ln P(t,T)})&=P(t,T)\bigg(d\ln P(t,T)+\frac{1}{2}(d\ln P(t,T))^2\bigg)\\ &=P(t,T)\bigg(d\ln A(t,T)-r_tdB(t,T)-B(t,T)dr_t+\frac{1}{2}B(t,T)^2\sigma^2r_tdt\bigg)\\ &=\ldots\\ &=r_tP(t,T)dt-B(t,T)P(t,T)\sigma\sqrt{r_t}dW_t \end{align} Although I have followed the steps for Ito's Lemma, I seem to be missing a detail that will allow some terms to cancel out to produce the final line. Moreover the functions $A(t,T)$ and $B(t,T)$ are quite complex and I don't think differentiating them would be a good idea. $$A(t,T)=\bigg[\frac{2h\exp{\{(k+h)(T-t)/2\}}}{2h+(k+h)(\exp{\{(T-t)h\}-1})}\bigg]^{2k\theta/\sigma^2}$$ $$B(t,T)=\frac{2(\exp{\{(T-t)h\}-1)}}{2h+(k+h)(\exp{\{(T-t)h\}-1})}$$ $$h=\sqrt{k^2+2\sigma^2}$$ Source: Brigo & Mercurio, Interest Rate Models, 3.2.3