add nested def and instance for the parent node.