In this work a variational principle is proposed to study the existence and structure of Weiss domains in elastic ferroelectric crystals. Weiss domains are defined as certain subregions of the crystal in each of which the polarization vector is uniform and has a constant magnitude which is equal to the saturation polarization per unit mass for the crystal. The variational principle differs from previous ones in that the variations of the domain walls are also taken into account and it is a direct generalization of the one corresponding to the rigid crystals which we have proposed earlier. In deriving the general theory the dependence on the polarization gradients are also considered and the effect of this dependence when passing from one domain to another is represented by an appropriately chosen surface energy on domain walls. The domain structure is studied under homogeneous deformation. The effect of a small deformation field on the shape of domains is illustrated in the case of a rectangular uniaxial crystal which has initially no electric field inside. It shown that the deformation creates a small electric field in the crystal and domain walls change slightly.