/// <summary>
        ///  Deserialize the relations for a relation type.
        /// </summary>
        private IEnumerable <uSyncChange> DeserializeRelations(XElement node, IRelationType relationType, SyncSerializerOptions options)
        {
            var changes = new List <uSyncChange>();

            var existing = relationService
                           .GetAllRelationsByRelationType(relationType.Id)
                           .ToList();

            var relations = node.Element("Relations");

            // do we do this, or do we remove them all!
            if (relations == null)
            {
                return(Enumerable.Empty <uSyncChange>());
            }

            var newRelations = new List <string>();

            foreach (var relationNode in relations.Elements("Relation"))
            {
                var parentKey = relationNode.Element("Parent").ValueOrDefault(Guid.Empty);
                var childKey  = relationNode.Element("Child").ValueOrDefault(Guid.Empty);

                if (parentKey == Guid.Empty || childKey == Guid.Empty)
                {
                    continue;
                }

                var parentItem = entityService.Get(parentKey);
                var childItem  = entityService.Get(childKey);

                if (parentItem == null || childItem == null)
                {
                    continue;
                }

                if (!existing.Any(x => x.ParentId == parentItem.Id && x.ChildId == childItem.Id))
                {
                    // missing from the current list... add it.
                    relationService.Save(new Relation(parentItem.Id, childItem.Id, relationType));
                    changes.Add(uSyncChange.Create(relationType.Alias, parentItem.Name, childItem.Name));
                }

                newRelations.Add($"{parentItem.Id}_{childItem.Id}");
            }


            if (options.DeleteItems())
            {
                var obsolete = existing.Where(x => !newRelations.Contains($"{x.ParentId}_{x.ChildId}"));

                foreach (var obsoleteRelation in obsolete)
                {
                    changes.Add(uSyncChange.Delete(relationType.Alias, obsoleteRelation.ParentId.ToString(), obsoleteRelation.ChildId.ToString()));
                    relationService.Delete(obsoleteRelation);
                }
            }

            return(changes);
        }