Yes, 227 sts sounds like the right amount to cast for all 3 sections. Then you work to the underarm, bind off sts and the 39, 99, 39 is probably what you have left for each piece then, or after you dec for the armhole shaping. If you have a direct link to the pattern we can double check that, but that's probably what's going on.
As for 227 'not being enough sts' for the XL, it's possible that when you're done with the sweater you'll add buttonbands which would add an inch or 3 more.
sue- knitting heretic