Generalize XML iterator.

This'll be useful for reworking the VDR record counter.
A faster record counter.