Energy-efficiency is a key problem in wireless sensor networks(WSNs) due to the severe power constraint of wireless nodes. When designing protocols for WSNs, it is important for us to consider not only network performance, but also energy consumption. It is difficult for a traditional layered design method to satisfy several objectives at the same time. In this paper, we introduced a cross-layer scheme for WSNs, by adopting the microeconomic concept of utility to balance energy consumption as well as QoS constraint among all nodes at the same time. The proposed scheme can improve the overall network performance.