dup attributes in nested document so they don't get clobbered