Spectrum sharing and energy harvesting (EH) are promising techniques to enhance the spectrum and energy efficiency of wireless networks. In this paper, we propose a spectrum sharing scheme based on the cooperative energy and data transfer in both the time and space domains. When the primary base station (PB) transfers energy to the primary user (PU), the secondary user (SU) can transmit its own data simultaneously, and the interference of secondary data transmission becomes beneficial to improve the EH efficiency of the PU. Furthermore, the SU can assist the primary data relaying using the Alamouti coding technique to improve the link robustness through introducing the space diversity. With the energy and data cooperation from the SU, the primary data can be more quickly and reliably delivered, and hence more opportunities can be achieved for the spectrum sharing. Considering the dependence of the energy and data transfer, the throughput of both systems is investigated. The time allocation between EH and data transmission can be numerically determined by maximizing the throughput of secondary system under the throughput constraint of primary system. Performance results are presented to validate our theoretical analysis and provide some guidelines for the network configuration.