I have the XT...the little brother of the XTi, and it's very comfortable for me to hold. I have medium sized teenaged guy hands...and it works for me. If you have bigger hands, you can get the battery grip to make up for it's small size. It feels great to hold. Also, Canon makes some really great lenses that are priced right...I haven't researched Nikon as much, I'm sure they have some nice stuff.
Either way, you're getting a nice camera, but I think value for money at this point in time you should be looking at the XTi over the D40.