I am trying to apply Ito's formula to $$P(t, X_t) = \mathbb{E}^\mathbb{Q}\left[\exp\left(-\int_t^{T}r(X_s)ds\right)\middle|X_t\right]$$ where $T$ is a fixed constant and $$ dX_t = \mu\left(X_t\right)dt + \sigma(X_t)dZ_t.$$ I'm only interested in obtaining the term in front of dt which I understand should be $r(X_t)P(t,X_t)$ but I do not see how?
If you apply Ito's formula you get \begin{equation} \tag{1} dP = r(X_t)P(t,X_t)dt +\ldots dX_t + \frac12\frac{\partial^2P}{\partial X_t^2}\sigma^2dt \end{equation} where I'm not sure what should be in the dots, presumably it must be $0$ otherwise the result would not be correct but I do not see this. Also can anyone provide a justification for applying Ito under the expectation?
[For context this appears in Duffie-Kan 1996 in the derivation for equation (3.5) https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=&ved=2ahUKEwjfo_Oqg5b5AhVxm1wKHf3FByoQFnoECAgQAQ&url=https%3A%2F%2Fwww.darrellduffie.com%2Fuploads%2Fpubs%2FDuffieKan1996.pdf&usg=AOvVaw2eP5RVrNc3m5LJ7rBiT44c]