Measurement of the B→Xsγ branching fraction and photon energy spectrum using the recoil method