public ProcessInstance Parse(XElement root) { var processInstance = new ProcessInstance(); var processInstanceElement = root.Element(XmlParsersConfig.ElementProcessInstance); if (processInstanceElement == null) { throw new Exception("ProcessInstanceElement not found"); } var processId = int.Parse(processInstanceElement.Attribute(XmlParsersConfig.AttributeId).Value); var processKindId = int.Parse(processInstanceElement.Attribute(XmlParsersConfig.AttributeKindId).Value); //var processStartTime = DateTime.ParseExact(processInstanceElement.Attribute(XmlParsersConfig.AttributeStartTime).Value, XmlParsersConfig.DateTimeFormat, CultureInfo.InvariantCulture); //var processExpectedEndTime = DateTime.ParseExact(processInstanceElement.Attribute(XmlParsersConfig.AttributeExpectedEndTime).Value, XmlParsersConfig.DateTimeFormat, CultureInfo.InvariantCulture); processInstance.Id = processId; processInstance.ProcessKindId = processKindId; //processInstance.StartTime = processStartTime; //processInstance.ExpectedEndTime = processExpectedEndTime; var transactionElements = processInstanceElement.Elements(XmlParsersConfig.ElementTransactionInstance); foreach (var transactionElement in transactionElements) { var transactionInstance = ParseTransactionInstance(transactionElement); ParseTransactionChildren(transactionElement, transactionInstance); processInstance.AddTransaction(transactionInstance); } return(processInstance); }