Here's how I do it (I think it's a little easier to understand):
var group = XDocument.DOM.selectNodes( "/Xpath/to/items" );
while( curNode = group.nextNode() )
{
var field1 = curNode.selectSingleNode( "field1" );
var field2 = curNode.selectSingleNode( "field2" );
var field3 = curNode.selectSingleNode( "field3" );
XDocument.UI.Alert( "field1: " + field1.text + " field2: " + field2.text + " field3: " + field3.text );
}
---------------
Matt Faus
InfoPath Dev Texas
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge