Refacrored XmlLoader.cs class