'Remove callable as observer for an event.
The observer callable is removed for all priority levels for the
specified event.
@param event: Event for which the observer callable was registered.
@type event: C{str} or L{xpath.XPathQuery}
@param observerfn: Observer callable to be unregistered.'

def removeObserver(self, event, observerfn):

    if (self._dispatchDepth > 0):
        self._updateQueue.append((lambda : self.removeObserver(event, observerfn)))
        return
    (event, observers) = self._getEventAndObservers(event)
    emptyLists = []
    for (priority, priorityObservers) in iteritems(observers):
        for (query, callbacklist) in iteritems(priorityObservers):
            if (event == query):
                callbacklist.removeCallback(observerfn)
                if callbacklist.isEmpty():
                    emptyLists.append((priority, query))
    for (priority, query) in emptyLists:
        del observers[priority][query]
