G,day mate,
Firstly, welcome to the forum and good luck with your research. Secondly, i agree with Morticus, you will open up old wounds if you try to start a new D40 vs D22 thread. (fark it do it) Both vehicle are totally different beasts, i know i have had the pleasure of owning both.
First i had a 2003 D22 STR with all the fruit and then i bought a 2006 Spanish built D40 STX with all the fruit, both were Mexicans (Manuals.)
Engines: stock standard, the D40 is more powerful.
Gearboxes: I preferred the D22 manual gearbox over the D40, i am old school and like the manual transfer-case lever operation opposed to the D40's electronic set-up. Furthermore, the clutch set-up on the D22 is a stronger set-up than the D40. However, if you do what i did, that is replace the D40's dual-mass flywheel clutch set-up and replace it with a solid direct clutch set-up from Brisbane, then you will have a pearler of clutch.
Cabin space: The room and comfort in the D40 farken shits over the D22. End of story!
Price: D22 shits over the D40, both new and second-hand. That said, the bottom line is, that it always comes down to what your budget is, and what goodies you want to fit to your vehicle!
This is only my opinion and my sometimes my opinion is usual jack-shit!
Regards,
RLI