I think this can do the job with RegEx:
String str="b1<HEADER>aaaaa</HEADER>b2";
String newstring = str.replaceAll("<HEADER[^>]*>([^<]*)<\\/HEADER>", "");
System.out.println(newstring);
This prints b1b2
In the case that you have other tags inside <HEADER>
the above will fail. Consider the below example :
String str = "b1<HEADER>aa<xxx>xx</xxx>aaa</HEADER>b2";
String newstring = str.replaceAll("<HEADER[^>]*>([^<]*)<\\/HEADER>", "");
System.out.println(newstring);
This prints: b1<HEADER>aa<xxx>xx</xxx>aaa</HEADER>b2
To overcome this and remove also the containing tags use this:
newstring = str.replaceAll("<HEADER.+?>([^<]*)</HEADER>", "");
This will print b1b2
.