The D40x (and to a lesser degree, D40) constitutes one of Nikon's more hidden gems. It is a surprisingly capable camera and has proven itself more robust than far "higher-end" models of various brands. I say no more.
I think I'm down to just one or two units now, one of them modified for IR. I used to have one modified for UV that served me well for years, but finally had to give way for a D3200 as it didn't support GPS. In all other respects, it surely delivered quality results. As I have CPU-modified virtually all my F-mount lenses, they could be used on the various D40/D40X bodies unrestricted and with full metering.
The entire discussion of "obsolete" cameras is quite strange. I prefer to think of this as something providing diversity in the expressions you can achieve, much like swapping film types in the old days. There are of course some practical issues that can crop up, such as getting replacement batteries, but the blooming cottage industry of China et al. solves that easily.