Canon 1000D is quite low-end model: everything is plastic, you don't have normal display so you need to set up metering on the main LCD, and you have only one dial. 40D has all of this, so using it will be much more comfortable, and you'll be able to set camera faster, if that matters to you. It's also significantly faster in terms of continuous shooting speed, which is useful for sports, kids or basically anything that moves quickly.
My recommendation would be to go for 40D if it's in good state and if you intend to play with the camera more. If you want just usual vacation pictures or size/weight is important to you, you might prefer smaller and lighter 1000D. (Which, of course, can also be used for "serious" photoshoots, it's just not that fast to get to everyting.)
From technical point of view, they both have similar sensors, so it's really mostly between better+bigger vs. small+plastic. Comparison with some comments can be seen at Snapsort.