Make ResultBuilder's "indexed mode" work consistently.

This should largely prevent the nasty fatal errors
we got from API calls with XML format.

Bug: 59876
Change-Id: Ie06743e5409e5fa0d469b4506871bb9b760f6eda