You could have made the same argument my assembler analogy already and I actually expected you to do so.

And depending on the type of array you are looping through foreach can actually be faster.
And to actually say something relevant to the OP: If you use UIbuilder there are buttons on the preview panel to align UI elements. Although I always did it mathematically by hand. And maybe to clarify what Aditu has explained: PackLocation is only relevant when you resize the window in game to a different size than what it says in the XML. It is used to adjust the location of elements with respect to other elements. The complementary attribute is PackSize which does the same for the size.