You're addressing the fields the wrong way.
I' guessing that the subform "wrap" is the one, that contains the textfield and is going to be repeated, right?
The loop than should look this way:
var cSel = this.rawValue,
oFields = xfa.resolveNodes("form1.P1.wrap[*].textfield2"), // wrap[*] means every instance of the subfom wrap.
i;
for (i = 0; i < oFields.length; i += 1) {
oFields.item(i).presence = cSel == "1" ? "visible" : "hidden";
}