As they guy above says there are plenty of threads but here is my 2 cents (I have an XTi and love it).
It is 6MP vs 10.1MP (D40 vs XTi) just so you know so you might want to look at the D60.
Both are good cameras so at the end of the day it is which camera feels best for you and also which lens collection you like better. There are also a couple of other cameras you could look at - D60, XSi and 1000D (think its out now - XTi replacement). All are similar price and all the Canon's have a similar feel (and so do the Nikon's). But seriously go into a camera shop and 'play' with each one to get a feel for it, whichever one feels best for you is the one you buy...
"Without the possibility of Death, adventure is not possible" Reinhold Messner
My Photos: http://www.flickr.com/photos/hnosyalnif/collections/