foreach (TreeNode node3 in studyNode.Nodes) { if (!(node3.Text == this.modalityConstraint)) node3.Remove(); }