Stanza/Packet validation of incoming data

I’m interested in the way Openfire validates the incoming stanzas. I could not find any hint in the code. For me it looks like that the ByteBuffer input (NIO) from Mina was converted to a string, than parsed with dom4j. With the dom4j element it will generate a Packet (Message/Presence/IQ) from the Tinder library.

Can someone please help me find the place in code, where the structur of a stanza is checked against the RFC standard. I would like to compare my approach to the approach of the Openfire project. I experementing with a stanza parser for a university project.

Thank’s for your hints.

Dominic