def ComputeMultiplicity(name, infos):
    """
    Method that generate the method for generating the xml tree structure model by
    following the attributes list defined
    """
    if infos['minOccurs'] == 0:
        if infos['maxOccurs'] == 'unbounded':
            return '(?:%s)*' % name
        elif infos['maxOccurs'] == 1:
            return '(?:%s)?' % name
        else:
            return '(?:%s){,%d}' % (name, infos['maxOccurs'])
    elif infos['minOccurs'] == 1:
        if infos['maxOccurs'] == 'unbounded':
            return '(?:%s)+' % name
        elif infos['maxOccurs'] == 1:
            return '(?:%s)' % name
        else:
            return '(?:%s){1,%d}' % (name, infos['maxOccurs'])
    elif infos['maxOccurs'] == 'unbounded':
        return '(?:%s){%d,}' % (name, infos['minOccurs'])
    else:
        return '(?:%s){%d,%d}' % (name, infos['minOccurs'], infos['maxOccurs'])
