display feature list

I am trying to create a feature list widget similar to the Layers widget - currently I am only getting the top layer name & its feature layer names - how do I get the actual feature names displayed in the tree too - (under its feature layer name)?