protected void foundMsg(String msg) throws XMLNotWellFormedException {
        // Add message to the complete message list
        if (msg != null) {
            if (hasIllegalCharacterReferences(msg)) {
                buffer = null;
                throw new XMLNotWellFormedException("Illegal character reference found in: " + msg);
            }
            msgs.add(msg);
        }
        // Move the position into the buffer
        status = XMLLightweightParser.INIT;
        tailCount = 0;
        cdataOffset = 0;
        head.setLength(0);
        insideRootTag = false;
        insideChildrenTag = false;
        depth = 0;
    }
This is a Light-Weight XML Parser.
It read data from a channel and collect data until data are available in
the channel.
When a message is complete you can retrieve messages invoking the method
getMsgs() and you can invoke the method areThereMsgs() to know if at least
a message is presents.

@author Daniele Piras
@author Gaston Dombiak
xmppserver/src/main/java/org/jivesoftware/openfire/nio/XMLLightweightParser.java