def _form_response(role, origin, response, timestamp):
    """Form a VOEvent Transport Protocol packet suitable for sending an `ack`
    or `iamalive` response."""
    return (
        '<?xml version=\'1.0\' encoding=\'UTF-8\'?><trn:Transport role="' +
        role +
        '" version="1.0" xmlns:trn="http://telescope-networks.org/schema/Transport/v1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://telescope-networks.org/schema/Transport/v1.1 http://telescope-networks.org/schema/Transport-v1.1.xsd"><Origin>'
         + origin + '</Origin><Response>' + response +
        '</Response><TimeStamp>' + timestamp + '</TimeStamp></trn:Transport>'
        ).encode('UTF-8')
