def loads(stream):
        """ Load an XML binary stream
        and return XML text as string """

        import cStringIO
        c=cStringIO.StringIO()

        try:
            p=BinXMLSAXParser()
            p.setContentHandler(XMLGenerator(c))
            p.parse(stream)
        except Exception, e:
            sys.exit(e)

        return c.getvalue()
 Load an XML binary stream
        and return XML text as string 
recipes/Python/415983_Simple_XML_serlializerdeserializer_using/recipe-415983.py