General relativity was summarised by Wheeler as "Spacetime tells matter how to move; Matter tells spacetime how to curve". I have a fairly good mental picture of how the first part works.
However, I don't have much of an understanding of the second part. In particular, what I'd like to know is whether the equations describing how matter tells spacetime "could have been different." In other words, did Einstein choose the form of his equations to fit empirical observations, or are they the sort of thing that are worked out entirely from first principles and can't be changed at all without breaking the whole theory?
Evidently there was some choice in choosing the equations, namely the cosmological constant - Einstein included it originally, then took it out, and now it seems like it might be there after all. But is adding a cosmological constant the only possible way in which Einstein's equations can be modified?
Another way to ask this question is to ask what assumptions are required to derive general relativity. I know that deriving special relativity really only requires the principle that the laws of physics (including Maxwell's equations) are the same in all intertial reference frames, and I know that the first part of Wheeler's quote comes from the principle of equivalence between gravity and acceleration. But what, if any, additional assumptions are required in order to determine the way in which matter curves spacetime?