This requirement of hiding and showing the values in the dialog is a common use case. I have found multiple blogs which discuss different ways of this but not a single consolidated place where you can use the XML directly.
Here, I am going to share the piece of code which can be reused directly.
Hide and show – Check-box
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.