reader.ReadToFollowing("alarm");
reader.MoveToFirstAttribute();
for (int j = 0; j <= i; j++)
{
reader.ReadToFollowing("attribute");
string name = reader.ReadElementContentAsString().ToString();
reader.MoveToAttribute("attribute");
string severity = reader.ReadElementContentAsString().ToString();
reader.MoveToAttribute("attribute");
string cause = reader.ReadElementContentAsString().ToString();
reader.MoveToAttribute("attribute");
string Time = reader.ReadElementContentAsString().ToString();
double timestamp = Convert.ToDouble(Time);
System.DateTime dateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
dateTime = dateTime.AddSeconds(timestamp);
dateTime = dateTime.AddHours(5);
string printDate = dateTime.ToShortDateString() + " , " + dateTime.ToShortTimeString();
string[] arr = printDate.Split(',');
string date = arr[0];
string time = arr[1];
reader.MoveToAttribute("attribute");
string nativ = reader.ReadElementContentAsString().ToString();
reader.MoveToAttribute("attribute");
string ip = reader.ReadElementContentAsString().ToString();
inserthistory(name, "0", nativ, date, time, ip);