Create A Messages.cs Class
public class Message
{
[Required]
public string Name { get; set; }
[Required]
public string Description { get; set; }
}
XmlNodeList xmlDescriptionNodes = xmlDoc.GetElementsByTagName("message");
if (xmlDescriptionNodes != null)
{
foreach (XmlNode xmlNode in xmlDescriptionNodes)
{
string Description = Convert.ToString(xmlNode.InnerText);
bool IsContain = Description.Contains(name);
if (IsContain == true)
{
Message message = new Message();
message.Name = Convert.ToString(xmlNode.Attributes["name"].Value);
message.Description = Convert.ToString(xmlNode.InnerText);
lmessage.Add(message);
}
}
}