Girsanov theorem and stopping time

Let $(\Omega,\mathcal{F},\mathbb{P})$ be a probability space, equipped with a filtration $(\mathcal{F})_{0 \leq t \leq T}$ which is a natural filtration of a standard Brownian motion $(W_{t})_{0 \leq t \leq T}$.

According to Girsanov's theorem, the process $X_t \buildrel\textstyle\over={W_t}+ {\lambda}t$ is a standard brownian motion under the $\mathbb{Q}$-measure defined by the Radon-Nikodym Derivative $\frac{\mathrm{d}\mathbb{Q}}{\mathrm{d}\mathbb{P}}=Z_T$ where $$Z_t=\exp\left(\frac{1}{2}\lambda^2t-\lambda X_t\right)$$.

If $\tau$ a stopping time with respect to filtration $\mathcal{F}_t$, I want to know if this equality is true for any function f:

$$\mathbb{E}^\mathbb{P}\left[f(X_\tau)\right]=\mathbb{E}^\mathbb{Q}\left[Z_\tau^{-1}f(X_\tau)\right]$$ I found a little proof in book:"MathematicalMethods for Financial Markets by Marc Chesney, Marc Yor et Monique Jeanblanc(2009) see $Proposition 1.7.1.4$ pp.66" I reorganized the demonstration as follows:

Let $X$ be a $\mathbb{P}$-integrable $\mathcal{F}_\mathcal{\tau}$-measurable random variable and $\mathbb{P}$ and $\mathbb{Q}$ be two equivalent probabilities such that $\mathbb{Q}|\mathcal{F}_t = L_t \mathbb{P}|\mathcal{F}_t$ where $L_t$ is a $(\mathbb{P},\mathcal{F}_t)$-martingale, we have under these assumptions and those quoted in the question the following equalities:

$$\mathbb{E}^\mathbb{P}\left[X\right]=\mathbb{E}^\mathbb{Q}\left[L_T^{-1}X\right]=\mathbb{E}^\mathbb{Q}\left[\mathbb{E}^\mathbb{Q}\left[L_T^{-1}X|\mathcal{F}_\tau\right]\right]=\mathbb{E}^\mathbb{Q}\left[X\mathbb{E}^\mathbb{Q}\left[L_T^{-1}|\mathcal{F}_\tau\right]\right]=\mathbb{E}^\mathbb{Q}\left[XL_\tau^{-1}\right]$$

The first equality is justified by the fact that $\mathcal{F}_\tau\subseteq \mathcal{F}_T$ if we assume that the stopping time $\tau$ is bounded by $T$, the second equality is trivial, the last two ties result from the fact that $X$ is $\mathcal{F}_\mathcal{\tau}$-measurable and $L^{-1}$ is a $(\mathbb{Q},\mathcal{F}_t)$-martingale.

What do you think, and how can we generalize this result for any function $\mathbb{P}$-integrable and $\mathcal{F}_\mathcal{\tau}$-measurable ?