The synthesis of polyhydroxylated indolizidines and pyrrolizidines belonging to the class of iminosugars, endowed with a vast and assorted biological activity, can be achieved in a straightforward manner by a general strategy consisting of a highly stereoselective 1,3-dipolar cycloaddition of polyhydroxylated pyrroline-N-oxides followed by simple transformations of the isoxazolidine adducts. The strategy allows the complete control of the relative and absolute stereochemistry of the numerous stereogenic centers decorating these compounds.