In this paper we propose a distributed, self organizing, robust and energy efficient data gathering algorithm for sensor networks operating in environments where all the sensor nodes are not in direct communication range of each other and data aggregation is used while routing. Proposed algorithm is based on local minimum spanning tree (LMST) structure, which nodes can construct from the position of their 1-hop neighbors. Reporting tree is constructed from the sink by allowing only edges of LMST to join the tree, plus possibly some direct links to the sink. Each node selects as parent the LMST neighbor so that the total energy cost of route to the sink is minimal. We also describe route maintenance protocols to respond to predicted sensor failures and addition of new sensors. Our simulation results show that our algorithm prolongs the network lifetime significantly compared to some alternative schemes.