public void ExportLanguageToXML(string filename)
{
XmlDocument doc = new XmlDocument();
XmlElement root = doc.CreateElement("ImageGlass");// <ImageGlass>
XmlElement nType = doc.CreateElement("Language");// <Language>
XmlElement nInfo = doc.CreateElement("Info");// <Info>
nInfo.SetAttribute("langCode", LangCode);
nInfo.SetAttribute("langName", LangName);
nInfo.SetAttribute("author", Author);
nInfo.SetAttribute("description", Description);
nInfo.SetAttribute("minVersion", MinVersion);
nInfo.SetAttribute("isRightToLeftLayout", IsRightToLeftLayout.ToString());
nType.AppendChild(nInfo);// <Info />
XmlElement nContent = doc.CreateElement("Content");// <Content>
foreach (var item in Items)
{
XmlElement n = doc.CreateElement("Item"); // <Item>
n.SetAttribute("key", item.Key);
n.SetAttribute("value", item.Value);
nContent.AppendChild(n);// <Item />
}
nType.AppendChild(nContent);
root.AppendChild(nType);// </Content>
doc.AppendChild(root);// </ImageGlass>
doc.Save(filename);
}