// create element remover filter
ElementRemover remover = new ElementRemover();
// set which elements to accept
remover.acceptElement("b", null);
remover.acceptElement("i", null);
remover.acceptElement("u", null);
remover.acceptElement("a", new String[] { "href" });
// completely remove script elements
remover.removeElement("script");