I would get the 40d! who says he isnt going to buy better glass soon??
From what Ive seent he 40d is alot better then the 400d but! Like others have said if its your first slr you will be happy with the 400d its a good camera to learn with and by the time you have learnt to use it properly the 40d will probaly come down a bit in price 
thanks
will






