Solution of the equation A(z)X(z) + X(z)B(z) = C(z) and its application to the stability of generalized linear systems†