Code:
sed -n '/<parent>/,/<\/parent>/{ H
/<\/parent>/{ s/.*//;x
/name2/d
p
}
}' testfile
<parent>
<child>name1</child>
<lots_of_other tags></lots_of_other_tags>
</parent>
<parent>
<child>name3</child>
<lots_of_other tags></lots_of_other_tags>
</parent>
May need more testing and there are probably better ways of doing it.
The first line uses a range between two parent tags (inclusive range). The `H' command appends the line to the Hold buffer.
The second line tests whether the line read in has the closing tag. If it does, the line buffer is cleared and swapped with the Hold buffer.
At this point, the regular buffer has the entire range in it with the `\n' character between lines.
the third line tests whether it contains `name2'. If so, it is deleted. If not, it is printed.