what should the script look like.

i.e. supply the xml file. and a example of what a couple of the entries 'scripted' should look like.

I'll then knock up a XSL script to do what you want.

Of course, theory can do the same.
Problem is I'm about to go to bed as its 11:30pm at night.
so I won't look at it until tomorrow [about 8 hours from now].