We propose a distributed algorithm to construct a balanced communication tree that serves in gathering data from the network nodes to a sink. Our algorithm constructs a near-optimally balanced communication tree with minimum overhead. The balancing of the node degrees results in the minimization of packet collisions during query execution, that would otherwise require numerous retransmissions and reduce the lifetime of the network. We compare our simple distributed algorithm against previous work and a centralized solution and show that for most network layouts it outperforms competition and achieves tree balance very close to the centralized algorithm. It also has the smallest energy overhead possible to construct the tree, increasing the lifetime of the network even more. Categories and Subject Descriptors H.4 [Information Systems Applications]: Miscellaneous General Terms Algorithms Keywords Query Tree, Communication Cost, Wireless Sensor Network, Collision, Optimization