A new and stereospecific route for introduction of nitrogen atom at C-5 of ribose and xylose via aza-Claisen rearrangements of thiocyanates.