I haven't actually washed my engine (water/soap/detergent etc) ..
But pretty much everytime I change my oil (every 5000km) or do any under the hood maintenance I get a few rags and go over the entire engine and clean it with WD40. It works like a charm and keeps the engine pretty much always looking brand new. Also don't have to worry about getting water and soap all over the place and into spots you can't clean it out from and what not. Less mess too. I have lot's of motorbikes over the years and you pretty much try and keep water off them any chance you can to avoid any rust so pretty much always cleaned my bikes from top to bottom with WD40 also and it always worked beautifully and kept the bikes looking super clean and new.