This paper presents XPAT, a novel algorithm for the generation of approximate circuits which employs an SMT solver to shape the final resulting circuit on a given parametrizable template. The solver outlines which products of which input literals must be included in the final circuit in order to undergo a given error constraint. A miter is created containing the exact circuit description, the template, and a measure of the tolerated error, and by carefully tuning some template key parameters, such as limiting the number of literals per product, this algorithm is able to derive circuits that outperform the state of the art in terms of area. XPAT retrieved circuits with area smaller than those found by state of the art methods in 75% of the cases, and on average obtained 9.85% (up to 60.4% in some cases) improvement in area savings.