more progress on iterating over the xml tree