This article in Scientific American points out the considerable energy potential in the "biosolids" content of wastewater. Methane from anaerobic digestion of sewage sludge can be used directly as a fuel and can power fuel cells. Biosolids themselves can also be used as a supplemental fuel in processes such as cement kilns.
But we like to point out that there is also a lot of "embedded energy" in the treated wastewater. Here in southern California and in many other areas of the county, our water is pumped from hundreds of miles away, treated, used once and then pumped out into the ocean. Shouldn't we make use of that embedded energy AND increase our water independence AND reduce pollution AND save money (compared to building seawater desalination facilities) by adding just a little more treatment and reusing that valuable wastewater?