Hi Henry, welcome to the forums!
Depends what you're using it for as to the advice you'll get.
If you're into off-roading and not carrying family around, the D22 is probably the best bet and it's cheaper than the D40.
If you have to carry family, particularly small children in car seats or baby capsules, the D40 is a necessity.
If you're going to do some heavy towing (1.5t and over) seriously consider the automatic over the manual in the D40 - the D40's power comes on strong at 2,000rpm and loves eating clutches, especially on hill starts. The D22 manual is much nicer on clutches as its power delivery is smoother.
Hope that gives you a start!