public XmlStringBuilder toXML() { XmlStringBuilder xml = new XmlStringBuilder(); xml.halfOpenElement("identity"); xml.xmllangAttribute(lang); xml.attribute("category", category); xml.optAttribute("name", name); xml.optAttribute("type", type); xml.closeEmptyElement(); return xml; }
/** * Add to, from, id and 'xml:lang' attributes * * @param xml */ protected void addCommonAttributes(XmlStringBuilder xml) { xml.optAttribute("to", getTo()); xml.optAttribute("from", getFrom()); xml.optAttribute("id", getStanzaId()); xml.xmllangAttribute(getLanguage()); }