Recursive array conversion