toArray() applied recursively