Change WriteXML to static class