Java tutorial
//package com.java2s; public class Main { public static String trimXml(String xml) { int start = 0, end = 0; start = xml.indexOf("<"); if (start < 0) { return ""; } end = xml.lastIndexOf(">"); if (end < 0) { return ""; } return xml.substring(start, ++end); } }