// <error type='modify'>
// <jid-malformed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
// </error>
// </presence>
StanzaBuilder builder = new StanzaBuilder(stanzaName);
builder.addAttribute("from", from.getFullQualifiedName());
builder.addAttribute("to", to.getFullQualifiedName());
if(id != null) builder.addAttribute("id", id);
builder.addAttribute("type", "error");
if(innerElements != null) {
for(XMLElement innerElement : innerElements) {
builder.addPreparedElement(innerElement);
}
}
builder.startInnerElement("error").addAttribute("type", type);
builder.startInnerElement(errorName, NamespaceURIs.URN_IETF_PARAMS_XML_NS_XMPP_STANZAS).endInnerElement();
builder.endInnerElement();
return builder.build();
}