Use the method that elgin2 suggests but, in case ammonia doesn’t work, try apple cider vinegar (preferably the unpasteurized kind if you can get it — direct from an orchard is typically the only place to get it). I have had better success with apple cider vinegar than ammonia, although ammonia seems to work too.
Make sure to rotate the tank when letting it sit. While the vast majority of the sludge will be on the bottom, the sides (and even the top) will have some sort of residue as well. I never have figured out a good way to seal the top of a gas tank once the gaskets and parts are removed. Anyone have any suggestions?