HQ Grade: B.. I think you were looking at reviews here:
http://www.digitalcamera-hq.com
Other good sites for detailed camera reviews is here:
http://www.dpreview.com/
These are different product lines, so simply put, the Canon EOS 40D is much nicer than the Nikon D40X. It's supposed to be. The 40D is the latest digital in Canon's "mid-range" line of cameras, while the D40x is the latest entry-level DSLR in Nikon's lineup.
There are more apt comparisons. The D40X is basically comparable to the Canon Digital Rebel XTi (400D in Europe), both consumer priced cameras, both with 10Mpixel sensors, both fairly small for SLR type cameras.
And moving up to low-end pro/prosumer models, the Canon 40D is on par with the Nikon D300. The Nikon's 12 Mpixel sensor edges out the Canon's 10 Mpixel sensor, but that's not the only basis for comparison. Both of these are built more rugged than their consumer counterparts, they have metal bodies and seals against moisture, deeper RAM buffers (more frames in a burst of photos), etc.
Yes, Canon uses 3-digit numbers for their low-end DSLRs, two for their mid-range; Nikon uses three digit numbers for their mid-range, two for the low-end. They both use single-digits for the pro models.
Anyway, I could easily recommend any of these cameras, and I'd have a hard time recommending anything other than Canon or Nikon for a DSLR... together, they cover something like 80% of that market. I own Canon film and digital SLRs, and a few Nikon film SLRs. My Dad has the Nikon D70 and D80.
I would recommend reading the reviews and actually handling these cameras in person. It probably will come down to which model fits your tastes the best, and of course, your budget. Of course, if you have a stash of Canon EOS lenses, or pretty much any Nikon SLR lens ever made, the decision might be a bit easier.
Also, keep in mind, when you invest in an SLR system, you are investing in a SYSTEM. There are additional lenses, intelligent flash units, all kinds of things. Both Canon and Nikon have long records of supporting this, and have very extensive lines of gear. No one else really compares, so if these things matter to you (or may some day), it may be worth taking a look at their product lines.