The classical Skorokhod embedding problem for a Brownian motion W asks to find a stopping time . is distributed according to a prescribed probability distribution .. Many solutions have been proposed during the past 50 years and applications in different fields emerged. This article deals with a generalized Skorokhod embedding problem (SEP): Let X be a Markov process with initial marginal distribution .0 be a probability measure. The task is to find a stopping time . such that X. s distributed according to .1. More precisely, we study the question of deciding if a finite mean solution to the SEP can exist for given .0 and the task of giving a solution which is as explicit as possible.have positive densities h0 and the generator . has a formal adjoint operator .., then we propose necessary and sufficient conditions for the existence of an embedding in terms of the Poisson equation ..H=h1.h0 and give a fairly explicit construction of the stopping time using the solution of the Poisson equation. For the class of Lévy processes, we carry out the procedure and extend a result of Bertoin and Le Jan to Lévy processes without local times.