<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def process_text(text, save_xml_name='trips_output.xml', save_xml_pretty=True, offline=False, service_endpoint='drum'):
 """Return a TripsProcessor by processing text. Parameters text : str The text to be processed. save_xml_name : Optional[str] The name of the file to save the returned TRIPS extraction knowledge base XML. Default: trips_output.xml save_xml_pretty : Optional[bool] If True, the saved XML is pretty-printed. Some third-party tools require non-pretty-printed XMLs which can be obtained by setting this to False. Default: True offline : Optional[bool] If True, offline reading is used with a local instance of DRUM, if available. Default: False service_endpoint : Optional[str] Selects the TRIPS/DRUM web service endpoint to use. Is a choice between "drum" (default) and "drum-dev", a nightly build. Returns ------- tp : TripsProcessor A TripsProcessor containing the extracted INDRA Statements in tp.statements. """

    if not offline:
        html = client.send_query(text, service_endpoint)
        xml = client.get_xml(html)
    else:
        if offline_reading:
            try:
                dr = DrumReader()
                if dr is None:
                    raise Exception('DrumReader could not be instantiated.')
            except BaseException as e:
                logger.error(e)
                logger.error('Make sure drum/bin/trips-drum is running in'
                              ' a separate process')
                return None
            try:
                dr.read_text(text)
                dr.start()
            except SystemExit:
                pass
            xml = dr.extractions[0]
        else:
            logger.error('Offline reading with TRIPS/DRUM not available.')
            logger.error('Error message was: %s' % offline_err)
            msg = """
                To install DRUM locally, follow instructions at
                https://github.com/wdebeaum/drum.
                Next, install the pykqml package either from pip or from
                https://github.com/bgyori/pykqml.
                Once installed, run drum/bin/trips-drum in a separate process.
                """
            logger.error(msg)
            return None
    if save_xml_name:
        client.save_xml(xml, save_xml_name, save_xml_pretty)
    return process_xml(xml)