The diastereoselective synthesis of castanospermine is described in 11 synthetic steps from L-xylose. The borono-Mannich reaction between L-xylose, allylamine and (E)-styrene boronic acid gives a tetrahydroxy amine with the desired configurations for C-6, C-7, C-8 and C-8a in the target molecule. A novel pyrrolo[1,2-c]oxazol-3-one precursor was employed to allow for the control of pi-facial diastereoselectivity in an osmium(VIII)-catalysed syn-dihydroxylation (DH) reaction. A regioselective ring-opening of the cyclic sulfate derivative of the resulting diol then secured the C-1 hydroxyl group of castanospermine with the correct configuration. A Mitsunobu cyclization then provided di-O-benzyl castanospermine and ultimately the final target alkaloid.