Very basic example of how it’s possible to manipulate menu items by destroying the Dock (requires v2.0+), changing it, and then re-initialising it. I’ve used a list, but the same principles apply for non-lists. Note that care needs to be taken with styling in order to get seamless transition between docked and undocked!
This is another list example, primarily to demonstrate that destroying a list returns it to its initial state. The list is not hidden, and you get to create it, and destroy it, at will. (This is functionality introduced in v2.0)