Iterator iterPages = resultPages.iterator();
while (iterPages.hasNext()) {
Element currentPage = (Element) iterPages.next();
String title = xpaTitle.valueOf(currentPage);
Element currentRev = (Element) xpaRev.selectSingleNode(currentPage);
String contents = xpaContents.valueOf(currentRev);
for (Page page : pages) {
if (Page.areSameTitle(page.getTitle(), title)) {
page.setContents(contents);
}