XQuery/Time Comparison with XQuery

Motivation
You have two identical lists of items with timestamps. You want to compare the items to see what items are newer.

Method
We will write a function that compares the timestamps of the items in two lists.

Sample Test Driver
Execute

Collating
Alternatively, two ordered lists can be collated to derive a set of updates. Here the items are wrapped in a div to carry the added information about the merge. Items in list1 but not list2 are flagged as new, items in list 2 but not list 1 as to be deleted and items which are newer in list 1 than list 2 as newer.

The sample data and main script are changed slightly:

Execute