replacing multi lines with 1 line

I have an xml file that is stripped down to output that looks bacically like;

         <!--   TABLEA header   -->
<tablea>
some fields
</tablea>
         <!--   TABLEB header   -->
         <!--   TABLEC header   -->
<tablec>
some fields
</tablec>

I want to remove the header where it contains no tag or field info (TABLEB) so output should look like;

         <!--   TABLEA header   -->
<tablea>
some fields
</tablea>
         <!--   TABLEC header   -->
<tablec>
some fields
</tablec>

In some cases files will have TABLEB info so only want to delete if no info is contained and the next line is another header comment. Any suggestions using a sed script or similar?

sed '
/TABLE/ {N
/\n.*TABLE/ D
}' input
sed '/<!--/{N;/\n.*<!--/D}'  infile

For inline file edit use -i option with sed sed -i ...

--ahamed

Thanks guys, that worked perfectly