If it made any sense (which I double, please see my comment to the question), I would advise to use, instead of stuctureless replace, direct DOM manipulations:
http://api.jquery.com/category/manipulation/dom-removal[
^].
[EDIT]
As Kornfeld Eliyahu Peter correctly pointed out, your HTML is absolutely invalid, so first, you need to address it: how did you get that invalid HTML in first place? When I say "if it made any sense", I meant that your request does no seem to make any practical sense.
—SA