What I usually do is use the Count() xPath function to get the number of nodes and then implement a loop in my process with a counter to get each element(in your case address[i]).
How are you creating a loop in the process. Is it an additional task(e.g. executing a java program) in the process?(If so can u please explain in detail)
Is there no way to fetch the data using a single xpath expression?
Not sure if this helps, there is a section about creating loops in the Workbench ES2 Help at http://help.adobe.com/en_US/livecycle/9.0/workbenchHelp/000187.html#1032146. Another way would be to use a custom component as you suggest but you can do it in Workbench as well.
Hope that helps..