'SAX parse XML text.
@param file: Parse a python I{file-like} object.
@type file: I{file-like} object.
@param string: Parse string XML.
@type string: str'

def parse(self, file=None, string=None):

    timer = metrics.Timer()
    timer.start()
    (sax, handler) = self.saxparser()
    if (file is not None):
        sax.parse(file)
        timer.stop()
        metrics.log.debug('sax    (%s)    duration:    %s', file, timer)
        return handler.nodes[0]
    if (string is not None):
        source = InputSource(None)
        source.setByteStream(StringIO(string))
        sax.parse(source)
        timer.stop()
        metrics.log.debug('%s\nsax    duration:    %s', string, timer)
        return handler.nodes[0]
