[Generator] modify Table Reader and XMLGenerator
1. add writeKeyInfo method
2. Source refactoring