private static void UpdateNodeFromNode(SettingsNode sourceNode, SettingsNode destinationNode) { if (sourceNode.IsList) { destinationNode.RemoveAllChildren(); destinationNode.ListLength = sourceNode.ListLength; } foreach (SettingsNode node in sourceNode.Nodes) { if (destinationNode.HasAValue) { destinationNode.RemoveAllChildren(); } if (destinationNode.Nodes.ContainsName(node.Name)) { UpdateNodeFromNode(node, destinationNode.Nodes[node.Name]); } else { destinationNode.AddChild(node.Clone()); } } }