Doug,
Re-read the posts, and not quite sure what you need. If you are trying to do this programatically, then you would want to have a go at the excludedLayers array.
However, it sounds kind of like you just want to be able to statically pick which layers/sublayers show in the TOC. If that is it, Robert has the excludelayer tag in the config.xml that lets you exclude either a layer, or some/all of the sublayers. No coding required.
R_