Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Indeed that is a simple solution if the scope of itemArray is greater than just the function and you don't mind keeping that sizable array in memory. If you are not calling this multiple times this will work just fine. In other more complex scenarios you may need to use the above method.
Finally got back to looking at this, as we will be starting our upgrades to SP2013 in the next few months. It works like a charm. Thanks for the info, should help others with this in future.