/// <summary>
 /// Loads the selection state of the contacts in the given store.
 /// </summary>
 void LoadContactsState(XmlElement contactsXmlElement,
                        StoreModel storeModel) {
   if (contactsXmlElement.GetAttribute(
         LKGStatePersistor.SelectionStateAttrName) == bool.FalseString) {
     storeModel.IsContactSelected = false;
   } else {
     storeModel.IsContactSelected = true;
   }
   foreach (XmlNode childXmlNode in contactsXmlElement.ChildNodes) {
     XmlElement childXmlElement = childXmlNode as XmlElement;
     if (childXmlElement == null) {
       continue;
     }
     if (childXmlElement.Name != LKGStatePersistor.ContactElementName) {
       continue;
     }
     string contactId =
         childXmlElement.GetAttribute(LKGStatePersistor.ContactIdAttrName);
     if (contactId == null || contactId.Length == 0) {
       continue;
     }
     string failureReason =
         childXmlElement.GetAttribute(
             LKGStatePersistor.FailureReasonAttrName);
     if (failureReason == null || failureReason.Length == 0) {
       storeModel.SuccessfullyUploaded(contactId);
     } else {
       FailedContactDatum failedContactDatum =
         new FailedContactDatum(childXmlElement.InnerText, failureReason);
       storeModel.FailedToUpload(contactId, failedContactDatum);
     }
   }
 }