Setting the height of the node layout to 0.
In this example shows how to collapse the node layouts that are auto-generated. The XamDataTreeNodeControl can be styled and applying a converter to check whether the XamDataTreeNodeDataContext is a layout. In the attached sample sets the Height property to 0 for collapsing.