This document proposes a Clustering Based Lifetime Maximizing Aggregation Tree (CLMAT) algorithm for wireless sensor networks. The algorithm aims to reduce energy consumption by creating an aggregation tree that minimizes distance traversed, energy consumed, and cost. It considers the three factors of energy, distance, and cost simultaneously when constructing the tree, unlike previous works. The tree is structured to maximize network lifetime by selecting nodes with higher residual energy as parents where possible. Pseudocode is provided to generate the aggregation tree using clustering by calculating branch and tree energy, distance, and cost at each step to ultimately select the tree with the highest lifetime, lowest energy consumption, distance, and cost.