A recursion formula for the correlation functions of an inhomogeneous XXX model