Note also when porting code from a D to an XD that AN2615 doesn't mention the following changes in register locations:
ATD registers:
HCS12: ATD0 = 0x80; ATD1 = 0x120
HCS12X: ATD0 = 0x2C0; ATD1 = 0x80
PWM registers:
HCS12: 0x00A0
HCS12X: 0x0300
This is obviously important if you plan on using the orignal DP headers, which may be the simplest option, as the XD uses a single header file with a different register naming convention.