LinuxCNC is a very cost effective method for controlling complex movement of devices mounted to an XZ stage.
Both Bill Ooms and Dewey Garrett use LinuxCNC in their machines, though they have taken different approaches.
Bill mounted a Quick Change Tool Post (QCTP) to his stage, and that is used to hold the cutting frame which is moved along the X or Z axes (or both). The object is held on a midi-lathe.
Dewey used his stage as the headstock, moving the object around whist the cutting frame remains fixed. (Dewey has stated that he'd take Bill's approach if he did it over).