I tried using xpath on an inherited tree view but it doesn't change the default value of the attribute optional.
<xpath expr="//field[@name='existing_field']" position="attributes">
<attribute name="optional">hide</attribute>
</xpath>
✅ EDIT: It now works by replacing the field and setting the optional attribute to 'hide'.
<xpath expr="//field[@name='existing_field']" position="replace">
<field name="existing_field" optional="hide"/>
</xpath>
✅ It now works by replacing the field and setting the optional attribute to 'hide'.
<xpath expr="//field[@name='existing_field']" position="replace">
<field name="existing_field" optional="hide"/>
</xpath>