Linear transformations are the dominating computation within many important applications. The natural multiply and accumulate feature of memristor crossbar arrays promise unprecedented processing capabilities to resistive dot-product engines (DPEs), which can accelerate approximate matrix-vector multiplication (MVM). Unfortunately, the precision of the analog computation may be degraded by parasitics, non-linear device characteristics, and variations. In this paper, we propose a framework called XMAP for mapping an arbitrary matrix into appropriate memristor conductance values (or state variables for non-linear devices). The specified conductance values are next programmed to the memristor hardware using accurate closed-loop tuning. XMAP is based on formulating the mapping problem as a mathematical optimization problem, which can be elegantly minimized using the concept of representable matrices, i.e., the matrices that can be represented on a crossbar. Compared with the state-of-the-art conversion algorithm, the computational accuracy is improved with up to 3.29X at the expense of overhead in run-time. The precision improvements translate into noteworthy application level benefits within signal compression and neural network inference.