Create a single navigation.xml that contains the menu structure for the entire document tree. Add all items and sub-items.
For items that can collapse when you are not browsing them, add collapse="true"
to the item declaration.
Now the menus will expand and collapse as you navigate through them.