Send raw XML strings? What's wrong?

I created an application which sends messages from one client to another. The messages are nothing but raw xml strings. This is what I did:

Message message = new Message();

message.setFrom(""); // for example

message.setBody("…"); // Set the raw xml string as the body of the message


But I kept receiving error stanzas from the server.

Messages type is not ‘chat’, ‘groupchat’ or ‘invite’

Can anyone help with this? Is it prohibited to send raw xml strings?