I have never done it but there is a nav_util function to create backups of the configuration as XML. There must be a way to import such XML. You should be able to manipulate the XML as needed prior to import.
BNY Mellon | 2 Hanson Pl AIM 111-0800 | Brooklyn NY 11217
Information Lifecycle Management
T 718.315.4763 | F 724.540.6622 | C 917.859.5180 | email@example.com