  We establish a local martingale $M$ associate with $f(X,Y)$ under some
restrictions on $f$, where $Y$ is a process of bounded variation (on compact
intervals) and either $X$ is a jump diffusion (a special case being a L\'evy
process) or $X$ is some general (c\'adl\'ag metric space valued) Markov
process. In the latter case $f$ is restricted to the form
$f(x,y)=\sum_{k=1}^K\xi_k(x)\eta_k(y)$. This local martingale unifies both
Dynkin's formula for Markov processes and the Lebesgue-Stieltjes integration
(change of variable) formula for (right continuous) functions of bounded
variation. For the jump diffusion case, when further relatively easily
verifiable conditions are assumed then this local martingale becomes an $L^2$
martingale. Convergence of the product of this Martingale with some
deterministic function (of time) to zero both in $L^2$ and a.s. is also
considered and sufficient conditions for functions for which this happens are
identified.
