Refactoring xml handling to XmlReader.cs and XmlWriter.cs