Highly stereoselective, one-pot synthesis of azetidines and 2,4-dioxo-1,3-diazabicyclo[3.2.0] compounds mediated by I2.