# Io Reference

Networking / Loudmouth / LoudmouthMessage

|  | LoudmouthMessage provides [[SGML]] interface with few convience methods for manipulation of XMPP messages.

asString

Converts XML to Sequence.
body

Returns value message's body node. If both XHTML and plain versions are available, XHTML version will be returned.
from

Returns sender's JID.
plainBody

Returns value of message's body node with XHTML markup.
sendVia(loudmouthConnection)

Converts message to sequence and sends it via the provided [[Loudmouth]] object. It updates `from` property and returns `true` if message is sent.
setFrom(jid)

Sets sender's JID. Returns `self`.
setTo(jid)

Sets message receiver to defined JID. JID can be both an [[Sequence]] or a [[JID]] object. Returns `self`.
setXmppType(type)

Sets value of `type` attribute.
to

Returns [[JID]] of receiver.
with(source)

Creates new [[LoudmouthMessage]] based on `source`, which should be valid XML ([[Sequence]]).
xmppType

Returns value of `type` attribute of message node.