Android examples for XML:XML Tag
create XML End Tag
public class Main{ public static void main(String[] argv) throws Exception{ String parTag = "java2s.com"; System.out.println(createEndTag(parTag)); }/*from w w w. java 2 s . c o m*/ public static String createEndTag(String parTag) { return createEndTag(0, parTag); } public static String createEndTag(int parIndent, String parTag) { return String.format("%s</%s>\n", indent(parIndent), parTag); } private static String indent(int parIndent) { StringBuilder indentBuilder = new StringBuilder(); for (int i = 0; i < (parIndent * Settings.getTabSize()); i++) { indentBuilder.append(" "); } return indentBuilder.toString(); } }