If you want to hide or show an XML element tag depending on a particular condition you can use the “Enabled” button (see below)
In this case I want to show the xml element if the customer name is not empty.
So enter a condition that returns true if the name is set and false if it is not.
IF(Invoice.Customer.Name <> "", true, false)
If it’s TRUE the xml element will be shown otherwise will be hidden
As you can see the conditional xml elements are marked with a “Question mark”