def process(self, data, url_object):
        """Process XML data.

        Converts document to json before processing with TextProcessor.
        if XML is not well formed, treat it as HTML
        """
        logging.info("Process XML %s" % url_object.url)

        try:
            data = json.dumps(xmltodict.parse(data))
            return self.text_processor.process(data, url_object)
        except ExpatError:
            return super(XmlProcessor,self).process(data,url_object)