Patrick -
Does the form require the use of "viewdata" as a secondary datasource? I've tried to incorporate the "count" and "lastitem" into my main datasource but am getting unexpected results.
i.e. replacing
xdXDocument:GetDOM("items")/items/item/a[../id = ...