What's the idea behind this new class?
You do not seem to change anything in the addchild calls of the lib, could you give a concrete example of when this would be useful?

Also, please don't forget to keep the coding style (4 spaces, no tabs, braces on new lines for classes and functions, etc...) -> php-cs-fixer could help!

Thank