xmlWriter refactured to use config