Move FOTreeListener registration and removal into getContentHandler() to fix SAX use case as demonstrated in ExampleXML2PDF.