Measurement of the B -> Xs gamma branching fraction and photon energy spectrum using the recoil method