@Nonnull
    protected String createRemoteStreamErrorBody(@Nonnull final StreamError error)
    {
        final Element body = DocumentHelper.createElement( QName.get( "body", "http://jabber.org/protocol/httpbind" ) );
        body.addAttribute("type", "terminate");
        body.addAttribute("condition", "remote-stream-error");
        body.add(error.getElement());
        return body.asXML();
    }
Creates an empty BOSH 'body' element that including a 'terminate' type attribute (that, in BOSH, signifies the
end of a session), sets the 'condition' attribute to 'remote-stream-error' (to signal that an XMPP error is
transported), and includes the error in the body.

@param error The error to be included in the body.
@return The string representation of a BOSH 'body' element.
xmppserver/src/main/java/org/jivesoftware/openfire/http/HttpSession.java