STOCK PURCHASE AGREEMENT dated as of July 24, 2004 by and between PNM RESOURCES, INC., and SW ACQUISITION, L.P.