We use the resonant dipole-dipole interaction between Rydberg atoms and a periodic external microwave field to engineer X X Z spin Hamiltonians with tunable anisotropies. The atoms are placed in one-dimensional (1D) and two-dimensional (2D) arrays of optical tweezers. As illustrations, we apply this engineering to two iconic situations in spin physics: the Heisenberg model in square arrays and spin transport in 1D. We first benchmark the Hamiltonian engineering for two atoms and then demonstrate the freezing of the magnetization on an initially magnetized 2D array. Finally, we explore the dynamics of 1D domain-wall systems with both periodic and open boundary conditions. We systematically compare our data with numerical simulations and assess the residual limitations of the technique as well as routes for improvement. The geometrical versatility of the platform, combined with the flexibility of the simulated Hamiltonians, opens up exciting prospects in the fields of quantum simulation, quantum information processing, and quantum sensing.