I would say you should hold them in you hands before you buy one. I shopped around for a long time on the internet reading every review I could till I couldn't stand it anymore. Then I got into a store that had a good line-up of camera's and held each one I researched in my hand to see which I liked the feel of the best.
No real comparison b/w the 2 if u can spend the 120 bucks more go for the Xti, gives u tons of more control & options which the D40 lacks.
If one were too choose between Xti with a D80 then u could go for the nikon'
The Nikon is a begginers SLR with linited options, now that you are upgrading get Xti.It is a small camera too for a SLR.
Between my D80 and the D40, the D40 still gives me control over everything I need. The D80 just gives me more direct access buttons and knobs to make adjustments quickly whereas you'll get bogged down in the D40's menus. I think that's true of the 30/40D and the XT/XTi though.In the Dpreview review they mentioned the lack of bracketing, depth-of-field preview, and also the fact that the exposure steps are fixed. These features are all nice but I think they aren't really vital, especially for an entry level SLR. Are these the only options you are talking about or are there more I am not aware of?

OMG LUCKY. Here in the UK it cost £300 >=(I can get it with the 18-55 mm lens for $470
---including a sweet 500mm telephoto lense. (it has been 10 years since I've seen this lense so I don't remember exactly what it was) I need a better macro lense right now for a project, so he is letting me borrow one of his. --I just wish he didn't live so far away.