':return: The length of the data to retrieve or self.max_data_len if the
XML is too long. In the case of an error, None is returned.'

def _get_data_len(self):

    om.out.debug(('Finding    XML    data    length    (max:    %s)' % self.max_data_len))
    maxl = self.max_data_len
    minl = 1
    while True:
        mid = ((maxl + minl) / 2)
        om.out.debug(('MAX:%i,    MID:%i,    MIN:%i' % (maxl, mid, minl)))
        if self._verify_data_len_eq(mid):
            om.out.debug(('Response    Length    FOUND!:    %i    ' % mid))
            return mid
        elif self._verify_data_len_lt(mid):
            maxl = mid
        else:
            minl = mid
