def query(self,sql):
    """
    Execute an SQL query on the server and fetch the resulting XML file
    back.

    @return: message received (may be empty) from LDBD Server as a string
    """

    msg = "QUERY\0" + sql + "\0"
    self.sfile.write(msg)

    ret, output = self.__response__()
    reply = str(output[0])

    if ret:
      msg = "Error executing query on server %d:%s" % (ret, reply)
      raise LDBDClientException, msg

    return reply
Execute an SQL query on the server and fetch the resulting XML file
    back.

    @return: message received (may be empty) from LDBD Server as a string