You might take a look at what Ernie has done with XML import and export for IMS in his lors package.
http://cvs.openacs.org/cvs/openacs-4/packages/lors/