To improve the performance of the wireless powered sensor network (WPSN), this paper proposes a frequency division duplex (FDD)-based on-demand energy transfer protocol and an energy-aware polling-based medium access control (MAC) protocol, called composite energy and data first (CEDF), by using the numbers of data packets and energy packets to determine polling priorities. The performance of the proposed MAC protocol, i.e., CEDF, along with the on-demand energy transfer protocol was evaluated through simulations, with comparison to the closely related protocols such as the round robin (RR) and data first (DF) polling protocols. Compared with RR and DF, our proposed CEDF performs much better in terms of throughput, data packet loss rate, and delay. Additionally, the doubly near–far problem in WPSNs under our proposed on-demand energy transfer protocol and CEDF was investigated to come up with good solutions to alleviate such a problem.