Here you can find the source of indentStr(int level)
public static String indentStr(int level)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { private static final String[] XMLIndent = { "", " ", " ", " ", " ", " ", " ", " " }; public static String indentStr(int level) { if (level < XMLIndent.length) { return XMLIndent[level]; } else {//from w ww.j a va2s .c o m return XMLIndent[XMLIndent.length - 1] + indentStr(level + 1 - XMLIndent.length); } } }