We consider the problem of refining unstructured quadrilateral and brick element meshes. We present an algorithm which is a generalization of an algorithm developed by Cheng et. al. for structured quadrilateral element meshes. The problem is solved for the two-dimensional case. Concerning three dimensions we present a solution for some special cases and a general solution that introduces tetrahedral and pyramidal transition elements.