I don't like your chances, mainly because the d22 uses a steering box and drag link setup, whereas the d40 uses a rack and pinion steering system. That's not to say it's not possible, I've actually wondered about being able to fit the d40 rack and pinion steering setup to my d22...
The abs shouldn't be a problem, the d22 has abs too so there shouldn't be an issue there.
The biggest issue will be the wheel stud pattern, d40s use a 6x114.3 pcd but the d22 uses a 6x139.7 pcd.. I don't know if you'd be able to get replacement rear alxe shafts with a pcd to match the front, although it may be possible to fit a patrol rear diff if the wheel track is the same. I think the d22 has a narrower track than the d40, otherwise you could fit the whole diff from a d22..
It would interesting to have a good look at though. ....