Jsoup is an open source java library for parsing and manipulating HTML with ease.
Get the latest binaries from http://jsoup.org/.
This requires the library jsoup-1.6.1.jar to be in classpath.
The following example shows removing all child nodes from a particular element.