How sort children pages tree by tag?

Hello please give me advice how to crate tree of links to children pages and show only which have some key tag (such as “closed”)?

Example with using some scripting:

{{velocity}}
#foreach ($docReference in $xwiki.tag.getDocumentsWithTag('test'))
  * [[$docReference]]
#end
{{/velocity}}
2 Likes

Thanks!