Implemented xml config generation.
Fixed assorted config generation bugs.