def normalize_to_xml(value, delimiter):
    if not delimiter:
        raise ValueError("delimiter must not be None")

    if isinstance(value, list):
        normalized_list = [six.text_type(x) for x in value]
        if any(delimiter in x for x in normalized_list):
            raise ValueError("list items cannot contain delimiter")
        normalized = delimiter.join(normalized_list)
    else:
        normalized = six.text_type(value)
        if delimiter in normalized:
            raise ValueError("value cannot contain delimiter")

    return normalized
dataset/ETHPy150Open CybOXProject/python-cybox/cybox/utils/__init__.py/normalize_to_xml/original