The index is used to give extra info. to the user-defined marshal functions for their benefit.  It is for cases where the item order is important, and/or for error/debugging, so the offending XML can be more easily located if there is a problem with only one element in a big list.  I will comment this more.