Here's the code for the start of a lua script to export the contents of the document into OPML. It's pretty bare.