not sure what these could be, is this a free growing tree or in a pot. Often, potted trees have a lot of manure in the compost which contain maggots. I bought a trident maple bonsai few years ago, got home from the nursery, went to re-pot it and a lot of maggots came out of the heavily manured compost.
The white worms you're seeing may be coming from the compost. If so, re-pot, rinse all the compost from the roots and replace with fresh. If the tree is free growing the problem may be the same but a little easier to deal with, spray around the roots with an insecticide, take advice as to what one from your garden centre. Of course, it may just be butterfly caterpillars.