private static string GetNamespaceByIndex( XPathNavigator nav, int index, out int count ) {
string thisValue = nav.Value;
string value = null;
if ( nav.MoveToNextNamespace( XPathNamespaceScope.Local ) ) {
value = GetNamespaceByIndex( nav, index, out count );
}
else {
count = 0;
}
if ( count == index ) {
Debug.Assert( value == null );
value = thisValue;
}
count++;
return value;
}