updated plugin to traverse child node tree