Refactor: Extract util.XPIterator adapter to its own class