The solution query begins with: declare variable $seq := fn:doc("mydoc.xml"); This should be: declare variable $seq := fn:doc("person_events.xml");
Thanks - I'll fix this.