Reading from Writer using Uno (and Python)

I hope somebody has an answer to this question. Given a loaded document

local = uno.getComponentContext()
resolver = local.ServiceManager.createInstanceWithContext("com.sun.star.bridge.UnoUrlResolver", local)
context = resolver.resolve("uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
desktop = context.ServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", context)
document = desktop.loadComponentFromURL("file:///Users/savage/test.odt" ,"_blank", 0, ())

How do I now actually read text from the document, preferably including some of the styling information like headings, or footnotes?

Thanks!

I don’t know how it works with Uno but for reading (and parsing) an odt-file with Python have a look at this: Extract and Parse ODF Files with Python