It's the server who is disconnecting you, not the client XMPP library, therefore this question is not really suited for the Smack forum.
And any sane XMPP server implementation will always terminate a XMPP connection that sends invalid, malformed stanzas for security reasons. I wonder why you don't consider doing the right thing, escaping the data? Smack has a convenient method for this: StringUtils.escapeForXML()