public void setIndent(int indent, boolean relative) throws RuntimeException {
    if (indent == 0 && !relative) {
      this.indentString = baseIndentString;
    } else if (indent > 0) {
      char[] ind = new char[indent];
      Arrays.fill(ind, ' ');
      String offset = this.indentString.copyValueOf(ind);
      if (relative) {
        this.indentString = this.indentString + offset;
      } else {
        this.indentString = offset;
      }
    } else {
      if (0 > indent) {
        if (relative) {
          int abs = -1 * indent;
          if (this.indentString.length() >= abs) {
            this.indentString = this.indentString.substring(abs);
          } else {
            //System.out.println("XMLWriter cannot have negative indentation");
            throw new RuntimeException("XMLWriter cannot have negative indentation");
          }
        } else {
          throw new RuntimeException("XMLWriter cannot have negative indentation");
        }
      }
    }
  }