The sensor's on the 40D and the XTi are not identical. The 40D has larger microlenses over the sensor which are supposed to help in gathering light. The 40D sensor also has 14 bit raw conversion as opposed to 12 bit. Not huge differences perhaps, but the sensors are distinct. The 40D also has a much improved auto-focus system than the XTi.
My advice is if you plan on shooting fast moving objects, sports, birds, wildlife, etc., then the features on the 40D are worth the extra cost. The increased frames per second and improved auto-focus engine will get you pictures in those situations that the XTi would miss.
If you're style of photography does not demand the speed in autofocus or frames per second, then the XTi will be fine and will take fantastic images for you. The real world difference in image quality between these two cameras is minimal.
The only other reason to go for the 40D if you don't need the extra features would be the size and ergonomics. Some people find the rebel series too small to comfortably handle. Altough, the battery grip for the rebel pretty much fixes that problem for much less $ than an upgrade to the 40D would cost.