D40 has 1/500 flash sync...XTI is only 1/200
XTI has 3fps..D40 has 2.5fps
D40 is lighter and smaller
XTI has ISO 100...D40 does not
D40 is cheaper
some pros and cons of each
Basically the D40 is for first time D-SLR user that doesn't have any lenses or isn't hooked on a certain brand yet.
The XTI is for someone that has used a D-SLR before but is still learning their way around them.
Or thats how I would describe them at least.