@Override
    public String toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) {
        StringBuilder buf = new StringBuilder();
        if (message != null) {
            buf.append("<error type=\"cancel\">");
            buf.append('<').append(message).append(" xmlns=\"").append(NAMESPACE).append(
                    "\"/>");
            buf.append("</error>");
        }
        return buf.toString();
    }
@ Override public String toXML ( org . jivesoftware . smack . packet . XmlEnvironment enclosingNamespace ) { StringBuilder buf = new StringBuilder ( ) ; if ( message != null ) { buf . append ( "<error type=\"cancel\">" ) ; buf . append ( '<' ) . append ( message ) . append ( " xmlns=\"" ) . append ( NAMESPACE ) . append ( "\"/>" ) ; buf . append ( "</error>" ) ; } return buf . toString ( ) ; }
Returns the error as XML.

@return the error as XML.