public String buildXML ( ) { StringBuilder response = new StringBuilder ( ) ; response . append ( "<Error" ) ; if ( code > 0 ) response . append ( String . format ( " httpcode=\"%d\"" , code ) ) ; response . append ( ">\n" ) ; if ( message != null ) response . append ( "<Message>" + getMessage ( ) + "</Message>\n" ) ; if ( context != null ) response . append ( "<Context>" + getContext ( ) + "</Context>\n" ) ; if ( otherinfo != null ) response . append ( "<OtherInformation>" + getOtherInfo ( ) + "</OtherInformation>\n" ) ; return response . toString ( ) ; }
Convert an ErrorResponse to the equivalent XML