We have investigated heteroepitaxial films of Sm-doped BiFeO3 with a Sm-concentration near a morphotropic phase boundary. Our high-resolution synchrotron X-ray diffraction, carried out in a temperature range of 25C to 700C, reveals substantial phase coexistence as one changes temperature to crossover from a low-temperature PbZrO3-like phase to a high-temperature orthorhombic phase. We also examine changes due to strain for films greater or less than the critical thickness for misfit dislocation formation. Particularly, we note that thicker films exhibit a substantial volume collapse associated with the structural transition that is suppressed in strained thin films.