NOVELTY - Treatment and management of water purification sludge, used to generate heat, electricity and chemicals in a self-contained system that includes a gasification stage and phosphate recovery.    USE - The process is particularly used in conjunction with large water treatment works for recovery of energy (heat and electricity) and chemicals (methanol), or at least some of the dehydrated sludge may also be used in agriculture. The phosphorus-containing gasification coke (typically 10-20% phosphorus pentoxide when derived from urban waste) is used, optionally after mixing with other minerals, for fertilizer production.    ADVANTAGE - All the sludge is utilized in various ways and the only by-product (coke from gasification) is also useful as a fuel or phosphorus source. The system is environmentally acceptable (it does not release dust or dioxins and reduces production of odors); allows sludge produced at different sites to be treated in a single unit; is self-sustaining and reduces the amount of sludge that has to be spread on fields (particularly important in urban areas). Gasification coke is a very inexpensive source of phosphate.    DETAILED DESCRIPTION - The process comprises:    (i) extracting (A) of volatiles content at least 70%;    (ii) anaerobic digestion of (A) to produce a stabilized/digested sludge (A') of volatiles content at least 60%;    (iii) thermal or chemical treatment of (A');    (iv) dehydrating to dry matter content 30-55%;    (v) drying to dry matter content at least 90% and    (vi) using the product directly as fuel or storing it and then subjecting it to gasification. The coke from gasification is used as fuel or as phosphorus mineral.    At least some of the material from step (iv) is used in agriculture. The final product, or the coke produced by gasification, is particularly used as fuel for cement making. The gas produced, a mixture of methane and carbon monoxide (CO), is:    (1) burnt and the heat generated used to dry the sludge or    (2) the CO is converted to methanol (and this is used as carbon source for biological denitrification of the waste water), while the methane only is used to generate heat and electricity for sludge drying.    DESCRIPTION OF DRAWING(S) - Flowchart of the process.