protected boolean isStartOfStream(final String xml) {
        return xml.startsWith("<stream:stream") || (xml.startsWith("<?xml ") && xml.contains("<stream:stream"));
    }
Checks if the provided XML data represents the beginning of a new XMPP stream.

@param xml The XML to verify
@return 'true' if the provided data represents the beginning of an XMPP stream.
xmppserver/src/main/java/org/jivesoftware/openfire/net/StanzaHandler.java