The documentTree macro now supports the expandToLevel parameter, to which we could migrate the depth parameter
https://extensions.xwiki.org/xwiki/bin/view/Extension/Document%20Tree%20Macro#HParameters