Problem with applying Ito

I want to show that the following expression is a local martingale: $$M_t=V(X_{t\wedge T})+\int_0^{t\wedge T}f(X_s)ds,$$ where $T$ is some stopping time (there are more conditions, but they are not important for my question).

Where $X$ is some process, and V is sufficiently nice for Ito to be applied. My problem is how to get around the problem, that the integral on the right ranges from $0$ to $t\wedge T$. My first inkling was to apply Ito to $X_{t\wedge T}$ first, but it does not seem to be working.

-

$$\mathrm dM_t=V'(X_t)\,[t\lt T]\,\mathrm dX_t+\frac12V''(X_t)\,[t\lt T]\,\mathrm d\langle X\rangle_t+f(X_t)\,[t\lt T]\mathrm dt$$

-
I have no doubt that this is correct, but could you clarify which version of Ito you are applying? My question was, essentially, how to make it rigorous. –  Tom Artiom Fiodorov May 17 '12 at 22:38
I have no doubt either. I know only one version of Itô equality. –  Did Sep 19 '12 at 18:19