Beginning of Writer refactoring.
Finish of XML Writer refactor and testing.