class XmlIndenter {

  private static final int INDENT = 2;

  public static void main(String[] args) throws IOException {<FILL_FUNCTION_BODY>}
}

    if (args.length != 1) {
      System.out.println("Usage: " + XmlIndenter.class.getSimpleName() + " <xmlFile>");
      System.exit(1);
    }
    List<String> lines = Files.readAllLines(Paths.get(args[0]), StandardCharsets.UTF_8);
    boolean inCategory = false;
    boolean inRuleGroup = false;
    boolean inRule = false;
    boolean inAntiPattern = false;
    boolean inPattern = false;
    boolean inMarker = false;
    boolean inAnd = false;
    boolean inUnify = false;
    boolean inUnifyIgnore = false;
    boolean inToken = false;
    for (String line : lines) {
      String origLine = line;
      line = line.trim();
      if (line.contains("</marker>") && (inPattern || inAntiPattern)) { inMarker = false; }
      if (line.startsWith("</antipattern>")) { inAntiPattern = false; }
      if (line.startsWith("</pattern>")) { inPattern = false; }
      if (line.startsWith("</rule>")) { inRule = false; }
      if (line.startsWith("</rulegroup")) { inRuleGroup = false; }
      if (line.startsWith("</category")) { inCategory = false; }
      if (line.startsWith("</and")) { inAnd = false; }
      if (line.startsWith("</unify>")) { inUnify = false; }
      if (line.startsWith("</unify-ignore>")) { inUnifyIgnore = false; }
      int level = INDENT + (inCategory ? INDENT : 0) + (inRuleGroup ? INDENT : 0) + (inRule ? INDENT : 0) +
        (inPattern ? INDENT : 0) + (inAntiPattern ? INDENT : 0) + (inMarker ? INDENT : 0) + (inToken ? INDENT : 0) +
        (inAnd ? INDENT : 0) + (inUnify ? INDENT : 0) + (inUnifyIgnore ? INDENT : 0);
      if (line.startsWith("<category") || line.startsWith("</category")) {
        level = INDENT;
      }
      if (line.equals("</token>")) {
        level -= INDENT;
      }
      String indentSpaces = StringUtils.repeat(' ', level);
      if (!line.isEmpty() && (inCategory || line.startsWith("<category") || line.startsWith("</category"))) {
        System.out.println(indentSpaces + line);
      } else {
        System.out.println(origLine);
      }
      if (line.startsWith("<category")) { inCategory = true; }
      if (line.startsWith("<rulegroup")) { inRuleGroup = true; }
      if (line.startsWith("<rule ") || line.startsWith("<rule>")) { inRule = true; }
      if (line.startsWith("<pattern")) { inPattern = true; }
      if (line.startsWith("<antipattern") && !line.contains("</antipattern")) { inAntiPattern = true; }
      if (line.contains("<marker>") && !line.contains("</marker>") && (inPattern || inAntiPattern)) { inMarker = true; }
      if (line.contains("<and>")) { inAnd = true; }
      if (line.contains("<unify>") || line.contains("<unify ")) { inUnify = true; }
      if (line.contains("<unify-ignore>")) { inUnifyIgnore = true; }
      if (line.contains("</token>") || (line.contains("<token") && line.contains("/>")) && (inPattern || inAntiPattern)) { inToken = false; }
      if (line.contains("<token") && !line.contains("/>") && !line.contains("</token>") && (inPattern || inAntiPattern)) {
        inToken = true;
      }
    }
  
<no_super_class>