Let me try to give you an example... if I have three tiddlers X, Y and Z. Within the parent tiddler X, I would like to return a list containing its child Y, provided Y is tagged with X AND Z is tagged with Y (ie X has a grandchild). However, if there were no tiddlers tagged with Y, then Y would not appear in the listing within X.
Does that make sense?
<$list filter="[all[current]tagging[]]" variable="child">
<$list filter="[tag<child>]" variable="grandchild">
<<child>> has grandchild <<grandchild>>
</$list>
</$list>
<$list filter="[tag<Parent>limit[1]]"> listwidget here is used to detect if there are grandchildren. It's limited to 1 instance, since you don't want to multiply grandchildren by grandchildren.
\define tagtable(Tag)
<ul>
<li><$link to="""$Tag$""">$Tag$</$link></li>
<ul>
<$list filter="[tag[$Tag$]]" variable="Parent">
<$list filter="[tag<Parent>limit[1]]">
<li><$link to=<<Parent>>><<Parent>></$link></li>
<ul>
<$list filter="[tag<Parent>sort[]]" variable="Child">
<li><$link to=<<Child>>><<Child>></$link></li>
<ul>
<$list filter="[tag<Child>sort[]]" variable="GrandChild">
<li><$link to=<<GrandChild>>><<GrandChild>></$link></li>
</$list></ul></$list></ul></$list></$list></ul></ul>
\end
<$macrocall $name="tagtable" Tag={{!!title}} />