Add a bunch of tests for xmlgenerator. Add xmlgen module. Fix documentation.