Different pathways of the metal-induced isomerization of D-xylose to D-xylulose are investigated and compared in detail using energy minimization and molecular dynamics simulation. Two theoretical models are constructed for the reaction: in vacuum and in the enzyme D-xylose isomerase. The vacuum model is constructed based on the X-ray structure of the active site of D-xylose isomerase. It contains the atoms directly involved in the reaction and is studied using a semi-empirical molecular orbital method (PM3). The model in the enzyme includes the effects of the enzyme environment on the reaction using a combined quantum mechanical and molecular mechanical potential. For both models, the structures of the reactants, products, and intermediate complexes along the isomerization pathway are optimized. The effects of the position of the "catalytic Mg2+ ion" on the energies of the reactions are studied. The results indicate: 1) in vacuum, the isomerization reaction is favored when the catalytic metal cation is at site A, which is remote from the substrate; 2) in the enzyme, the catalytic metal cation, starting from site A, moves and stays at site B, which is close to the substrate; analysis of the charge redistribution of the active site during the catalytic process shows that the metal ion acts as a Lewis acid to polarize the substrate and catalyze the hydride shift; these results are consistent with previous experimental observations; and 3) Lys183 plays an important role in the isomerization reaction. The epsilon-NH3+ group of its side chain can provide a proton to the carboxide ion of the substrate to form a hydroxyl group after the hydride shift step. This role of Lys183 has not been suggested before. Based on our calculations, we believe that this is a reasonable mechanism and consistent with site-directed mutation experiments.