state = IN_ELEMENT;
  public void addText (String text) {    if (state == EMPTY || state == DONE)      throw new IllegalStateException("text belongs inside an XML element");    if (state == IN_TAG)      buf.append(">");    encode(text);    state = IN_ELEMENT;  }