Thanks for that. I get 'story is undefined' - how do I defined the story (autoflowed text)?
Sorry for the newbie question - vascilating between various projects at the moment.
You need a reference to the auto-flowed story. I don't know how that line should fit into the rest of your script. If you don't either, try:
somewhere after the xml import.