Not got a D40x, but got a D40, same camera apart from the D40x is a 10mp I think.
I had a good look when I bought mine, I thought the Nikon gave a slightly sharper picture and the colour depth was better on it to.
Personally I'd go for the Nikon. I'm really pleased with mine.
I took these with my Nikon :