How to convert .xyz trajectory to MS .xtd?

Dear all,

Recently I have found this script

http://chembytes.wdfiles.com/local--files/materials-studio/xtd2xyz.pl

to convert trajectory from MS to a more general .xyz trj file. However, what I need is other way around, to create the xtd from xyz trajectory.

So, my question is, does anyone have a script for such a job, or in principle ideas how to do it with perl in MS?

The purpose of this is to further analyze my trajectories from some MD software, but in MS and use it as a starting point for some adsorption computations.

I could write a fortran code for analysis part, but perl in MS seems more suitable.

Best wishes

B.