Created a new class to manage common task of creating DOM from xml and write new XML.