Generate singletons using xml+xslt

Fixes issue #82