Code example for Stack

0
   
  @Override 
  public void startDocument() { 
    state = ParseState.EXPECT_EDITS_TAG;
    stanza = null;
    stanzaStack = new Stack<Stanza>();
    opCode = null;
    cbuf = new StringBuffer();
    nextTxId = -1;
  } 
   
  @Override 
  public void endDocument() { 
    if (state != ParseState.EXPECT_END) {
      throw new InvalidXmlException("expecting </EDITS>"); 
    } 
  } 
   
  @Override 
  public void startElement (String uri, String name,