Hi rjohnson,
I think you're wasting your time with this getDescendents() function! It's already implemented as an XPath axis. Check out this tutorial:
http://www.w3schools.com/xpath/xpath_axes.asp
Also, run this code snippet to get a feel of what's going on:
var nl = XDocument.DOM.selectNodes( "/my:myFields/descendant::*" );
var str = "";
while( (node = nl.nextNode()) != null )
{
//str += node.xml;
//str += node.text;
str += node.nodeName;
str += "\n------------\n";
}
//XDocument.DOM.selectSingleNode( "//my:field7" ).text = str;
XDocument.UI.Alert( str );
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge