<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_listener_destinations(self, server_id, listener_urls, owned=True):
 """ Register WBEM listeners to be the target of indications sent by a WBEM server. This function automatically creates a listener destination instance (of CIM class "CIM_ListenerDestinationCIMXML") for each specified listener URL in the Interop namespace of the specified WBEM server. The form of the `Name` property of the created destination instance is: ``"pywbemdestination:" {ownership} ":" {subscription_manager_id} ":" {guid}`` where ``{ownership}`` is ``"owned"`` or ``"permanent"`` dependent on the `owned` argument; ``{subscription_manager_id}`` is the subscription manager ID; and ``{guid}`` is a globally unique identifier. Owned listener destinations are added or updated conditionally: If the listener destination instance to be added is already registered with this subscription manager and has the same property values, it is not created or modified. If it has the same path but different property values, it is modified to get the desired property values. If an instance with this path does not exist yet (the normal case), it is created. Permanent listener destinations are created unconditionally, and it is up to the user to ensure that such an instance does not exist yet. Parameters: server_id (:term:`string`):
 The server ID of the WBEM server, returned by :meth:`~pywbem.WBEMSubscriptionManager.add_server`. listener_urls (:term:`string` or list of :term:`string`):
 The URL or URLs of the WBEM listeners to be registered. The WBEM listener may be a :class:`~pywbem.WBEMListener` object or any external WBEM listener. Each listener URL string must have the format: ``[{scheme}://]{host}:{port}`` The following URL schemes are supported: * ``https``: Causes HTTPS to be used. * ``http``: Causes HTTP to be used. This is the default The host can be specified in any of the usual formats: * a short or fully qualified DNS hostname * a literal (= dotted) IPv4 address * a literal IPv6 address, formatted as defined in :term:`RFC3986` with the extensions for zone identifiers as defined in :term:`RFC6874`, supporting ``-`` (minus) for the delimiter before the zone ID string, as an additional choice to ``%25``. Note that the port is required in listener URLs. See :class:`~pywbem.WBEMConnection` for examples of valid URLs, with the caveat that the port in server URLs is optional. owned (:class:`py:bool`):
 Defines the ownership type of the created listener destination instances: If `True`, they will be owned. Otherwise, they will be permanent. See :ref:`WBEMSubscriptionManager` for details about these ownership types. Returns: :class:`py:list` of :class:`~pywbem.CIMInstance`: The created listener destination instances for the defined listener URLs. Raises: Exceptions raised by :class:`~pywbem.WBEMConnection`. """


        # server_id is validated in _create_...() method.

        # If list, recursively call this function with each list item.
        if isinstance(listener_urls, list):
            dest_insts = []
            for listener_url in listener_urls:
                new_dest_insts = self.add_listener_destinations(
                    server_id, listener_url)
                dest_insts.extend(new_dest_insts)
            return dest_insts

        # Here, the variable will be a single list item.
        listener_url = listener_urls

        dest_inst = self._create_destination(server_id, listener_url, owned)

        return [dest_inst]