How to set node name and description programatically?

Currently, we could add node name and description manually through the user interface by right click. They are also saved in settings.xml as “customName”. Is it possible to set the displayed node name when the node is created within the Model/Dialog/Factory framework?