Thanks so much Mark - that is perfect - it returns the required data and I'm nearly there.
This is most likely an unrelated issue - formatting the dates returned using $date.Format(...) within the control structure is throwing up an error in the template: Call to a member function XML_val() on a non-object...
Have you heard of this before?