def __init__(self,data=None,initial_node=None):
        """ Takes two optional parameters: "data" and "initial_node".
            By default class initialised with empty Node class instance.
            Though, if "initial_node" is provided it used as "starting point".
            You can think about it as of "node upgrade".
            "data" (if provided) feeded to parser immidiatedly after instance init.
            """
        self.DEBUG(DBG_NODEBUILDER, "Preparing to handle incoming XML stream.", 'start')
        self._parser = xml.parsers.expat.ParserCreate()
        self._parser.StartElementHandler       = self.starttag
        self._parser.EndElementHandler         = self.endtag
        self._parser.CharacterDataHandler      = self.handle_cdata
        self._parser.StartNamespaceDeclHandler = self.handle_namespace_start
        self._parser.buffer_text = True
        self.Parse = self._parser.Parse

        self.__depth = 0
        self.__last_depth = 0
        self.__max_depth = 0
        self._dispatch_depth = 1
        self._document_attrs = None
        self._document_nsp = None
        self._mini_dom=initial_node
        self.last_is_data = 1
        self._ptr=None
        self.data_buffer = None
        self.streamError = ''
        if data:
            self._parser.Parse(data,1)
 Takes two optional parameters: "data" and "initial_node".
            By default class initialised with empty Node class instance.
            Though, if "initial_node" is provided it used as "starting point".
            You can think about it as of "node upgrade".
            "data" (if provided) feeded to parser immidiatedly after instance init.
            
chrome-cordova/gcmServer/xmpp/simplexml.py