<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_embeddedObject(self, val):
 # pylint: disable=invalid-name """ Parse and embedded instance or class and return the CIMInstance or CIMClass. Parameters: val (string):
 The string value that contains the embedded object in CIM-XML format. One level of XML entity references have already been unescaped. Example string value, for a doubly nested embedded instance. Note that in the CIM-XML payload, this string value is escaped one more level. :: <INSTANCE CLASSNAME="PyWBEM_Address"> <PROPERTY NAME="Street" TYPE="string"> <VALUE>Fritz &amp; &lt;the cat&gt; Ave</VALUE> </PROPERTY> <PROPERTY NAME="Town" TYPE="string" EmbeddedObject="instance"> <VALUE> &lt;INSTANCE CLASSNAME="PyWBEM_Town"&gt; &lt;PROPERTY NAME="Name" TYPE="string"&gt; &lt;VALUE&gt;Fritz &amp;amp; &amp;lt;the cat&amp;gt; Town&lt;/VALUE&gt; &lt;/PROPERTY&gt; &lt;PROPERTY NAME="Zip" TYPE="string"&gt; &lt;VALUE&gt;z12345&lt;/VALUE&gt; &lt;/PROPERTY&gt; &lt;/INSTANCE&gt; </VALUE> </PROPERTY> </INSTANCE> Returns: `None` if `val` is `None`. `CIMClass` or `CIMInstance` or a list of them, otherwise. Raises: CIMXMLParseError: There is an error in the XML. """


        if type(val) == list:  # pylint: disable=unidiomatic-typecheck
            return [self.parse_embeddedObject(obj) for obj in val]
        if val is None:
            return None

        # Perform the un-embedding (may raise XMLParseError)
        tup_tree = xml_to_tupletree_sax(val, "embedded object", self.conn_id)

        if name(tup_tree) == 'INSTANCE':
            return self.parse_instance(tup_tree)

        if name(tup_tree) == 'CLASS':
            return self.parse_class(tup_tree)

        raise CIMXMLParseError(
            _format("Invalid top-level element {0!A} in embedded object "
                    "value", name(tup_tree)),
            conn_id=self.conn_id)