We show how cross-phase modulation between two pulses, combined with optimal pulse shaping at the input of a dielectric medium, can be used to generate nearly single-cycle pulses that are tunable from the ultraviolet to the mid-infrared at the output of the medium, precompensating for dispersion to all orders.