People have said that the d40 kit lens is better than the xt or xti. I have an XTi and love it, the lens isn't tack sharp or anything like that but does it's job welll. As far as the body of the camera goes, I'd say it's in a level above the D40 (opinion)

The autofocus in the XTi is from the 30D, and is a step up from the XT. Number of points may not matter, but it seems faster and more accurate than my experience with the XT. In my limited experience with the D40, focusing seemed slower than the XTi and similar to an XT...

I bet some others have more informed opinions for you..