<stanza-kind
from="intended-recipient"
to="sender"
type="error" >
[OPTIONAL to include sender XML here]
<error
by="error-generator"
type="error-type" >
<defined-condition xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
[
<text
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"
xml:lang="langcode" >
OPTIONAL descriptive text
</text>
] [OPTIONAL application-specific condition element]
</error>
</stanza-kind>
<pre name="code" class="html"><iq id="wy2xa82b4" type="set" >
<bind xmlns="urn:ietf:params:xml:ns:xmpp-bind" >
<resource>balcony</resource>
</bind>
</iq>
<iq id="wy2xa82b4" type="error" >
<error type="cancel" >
<conflict xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
</error>
</iq>
<presence id="y2bs71v4" from="juliet@im.example.com/balcony"
to="characters@muc.example.com/JulieC" >
<x xmlns="http://jabber.org/protocol/muc" />
</presence>
<presence id="y2bs71v4"
from="characters@muc.example.com/JulieC"
to="juliet@im.example.com/balcony" type="error" >
<error type="auth" >
<forbidden xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" />
</error>
</presence>
<message id="sj2b371v"
from="romeo@example.net"
to="juliet@im.example.com/churchyard" type="error" >
<error
by="example.net"
type="cancel" >
<gone xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" >
xmpp:romeo@afterlife.example.net
</gone>
</error>
</message>
<message id="sj2b371v"
from="juliet@im.example.com/churchyard"
to="romeo@example.net" type="chat" >
<body>Thy lips are warm.</body>
</message>