You have to use Java regex to extract text between tags. Code snippet for the following is:
final Pattern pattern = Pattern.compile(“<tag>(.+?)</tag>”);
final Matcher matcher = pattern.matcher(“<tag>String I want to extract</tag>”);
matcher.find();
System.out.println(matcher.group(1)); // Prints String I want to extract