private (ProfileNode[], RuleNode[]) ConvertRulesAndProfiles(NodeList <ProfileNode> nodeProfiles, NodeList <RuleNode> nodeRules) { var rules = nodeRules.Except(Rules).ToArray(); var profiles = nodeProfiles.AddRange(nodeRules.Intersect(Rules).Select(x => Profiles[x.Id])).ToArray(); return(profiles, rules); }