handle flat list or tree
If it's an attribute, then we have to first duplicate the attrs hash (because otherwise these objects are shared). This will result in a ton of extra memory allocation & GC just for one field