<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _pcdata_nodes(pcdata):
 """Return a list of minidom nodes with the properly escaped ``pcdata`` inside. The following special XML characters are escaped: * left angle bracket (<) * Right angle bracket (>) * Ampersand (&) By default, XML-based escaping is used for these characters. XML-based escaping will cause the corresponding XML entity references to be used (for example, the ampersand character ``&`` will be represented as ``&amp;``, and the returned list contains one text node with the escaped pcdata string. Nesting of escaped pcdata is naturally supported with XML-based escaping. For example, if the pcdata string is ``a&amp;b``, the XML-escaped string will be ``a&amp;amp;b``. If the ``cim_xml._CDATA_ESCAPING`` switch is set to True, CDATA-based escaping is used instead. CDATA-based escaping will cause a CDATA section to be used for the entire string, or consecutive CDATA sequences (see discussion of nesting, below). The returned node list contains only CDATA section nodes. Example: The pcdata string ``a<b>c`` will become ``<![CDATA[a<b>]]>``, allowing the special XML characters to be used unchanged inside of the CDATA section. Nesting of escaped pcdata is supported with CDATA-based escaping, by using the following approach: If the input pcdata string already contains CDATA sections, they are split into separate strings, splitting the CDATA end token string in the middle, and these part strings are CDATA-escaped separately. See https://en.wikipedia.org/wiki/CDATA#Nesting for details. Escaping of already escaped pcdata is needed in support of nested embedded instances. That requires that each level of escaping can lateron be unescaped, one at a time. """


    nodelist = []

    if _CDATA_ESCAPING and isinstance(pcdata, six.string_types) and \
       (pcdata.find("<") >= 0 or
        pcdata.find(">") >= 0 or
        pcdata.find("&") >= 0):  # noqa: E129

        # In order to support nesting of CDATA sections, we represent pcdata
        # that already contains CDATA sections by multiple new CDATA sections
        # whose boundaries split the end marker of the already existing CDATA
        # sections.

        pcdata_part_list = pcdata.split("]]>")
        # ']]>' is the complete CDATA section end marker

        i = 0
        for pcdata_part in pcdata_part_list:
            i += 1

            left = "" if i == 1 else "]>"
            # ']>' is right part of CDATA section end marker

            right = "" if i == len(pcdata_part_list) else "]"
            # "]" is left part of CDATA section end marker

            # The following initialization approach requires Python 2.3 or
            # higher.
            node = CDATASection()
            node.data = left + pcdata_part + right

            nodelist.append(node)

    else:
        # The following automatically uses XML entity references
        # for escaping.

        node = _text(pcdata)

        nodelist.append(node)

    return nodelist