Read up on Ken Rockwells site regarding D40 and all things Nikon. Very good read
He is Nikon biased (to balance out the Canon recommendations). I bought the D40 with 18 - 55mm kit lens and soon upgraded to the 55 - 200mm VR lens. The D40x gives you more megapixels but not a better picture.
Suits me fine as I am still learning various features. Most guys who recommend more expensive cameras/lenses will already be more advanced in their shooting or have too much money burning holes in their wallets
Buy the best you feel you can justify. However there will always someone in photography who will state you should have bought something different.