There is a theory due to Tresse, which is unfortunately fairly complicated. It is explained, at least partly, in the book of Arnol'd, Geometric Methods in the Theory of Ordinary Differential Equations. Elie Cartan wrote a difficult paper on it, and this paper was explained more clearly in a paper of Bryant, Griffiths and Hsu, Toward a Geometry of Differential Equations. The possibility of finding coordinates in which both systems of curves are straight lines is precisely the vanishing of Tresse's invariants, which occurs just when your space $Z$ is given by a single quadratic equation in the space $X \times Y$, in some system of coordinates. Explicit formulae for Tresse's invariants are in the sources I mentioned. I wrote a paper on the relation of this problem to complex algebraic geometry: http://arxiv.org/pdf/math/0507087v5.
There is a theory due to Tresse, which is unfortunately fairly complicated. It is explained, at least partly, in the book of Arnol'd, Geometric Methods in the Theory of Ordinary Differential Equations. Elie Cartan wrote a difficult paper on it, and this paper was explained more clearly in a paper of Bryant, Griffiths and Hsu, Toward a Geometry of Differential Equations. The possibility of finding coordinates in which both systems of curves are straight lines is precisely the vanishing of Tresse's invariants, which occurs just when your space $Z$ is given by a single quadratic equation in the space $X \times Y$. Explicit formulae for Tresse's invariants are in the sources I mentioned.