  Recursive blocked algorithms have proven to be highly efficient at the
numerical solution of the Sylvester matrix equation and its generalizations. In
this work, we show that these algorithms extend in a seamless fashion to
higher-dimensional variants of generalized Sylvester matrix equations, as they
arise from the discretization of PDEs with separable coefficients or the
approximation of certain models in macroeconomics. By combining recursions with
a mechanism for merging dimensions, an efficient algorithm is derived that
outperforms existing approaches based on Sylvester solvers.
