result = result.replaceAll(">\\s*<", "><").replaceAll("<\\?([^>|^\\?]*)\\?>", "");
String json = result;
Matcher matcher = Pattern.compile("<([^>|^/]*)>").matcher(result);
while(matcher.find()){
for (int i = 0; i < matcher.groupCount(); i++) {
String s = matcher.group(i+1);
json = json.replaceAll("<"+s+">([^<|^\"]*)"+s+">", "\""+s+"\":\"$1\",");
}
}