I have to convert a xml file to html
i have a template matching eache tag (<b><i>...)
i have to escape the <br> tag when a <a> tag are following

ex. <br>text = carriage return + text

but

<br><a href>text</a> = text

any suggestion?