There are messages:
<Employees xmlns="https://services">
<Employee>
<SNILS>111-111-111-1</SNILS>
<Name>Den</Name>
<Sex>M</Sex>
</Employee>
</Employees>
<Employees xmlns="https://services">
<Employee>
<SNILS>111-111-111-2</SNILS>
<Name>Elena</Name>
</Employee>
</Employees>
<Employees xmlns="https://services">
<Employee>
<SNILS>111-111-111-3</SNILS>
<Name>Elena</Name>
<Sex/>
</Employee>
</Employees>
output should be look like this:
<Employees xmlns="https://services">
<Employee>
<SNILS>111-111-111-1</SNILS>
<Name>Den</Name>
<Sex>M</Sex>
</Employee>
</Employees>
<Employees xmlns="https://services">
<Employee>
<SNILS>111-111-111-2</SNILS>
<Name>Elena</Name>
<Sex>W</Sex>
</Employee>
</Employees>
<Employees xmlns="https://services">
<Employee>
<SNILS>111-111-111-3</SNILS>
<Name>Elena</Name>
<Sex>W</Sex>
</Employee>
</Employees>
we must add a new element.
added a block diagram:
put the value I got
<enrich>
<source xpath="get-property('VALUE')"/>
<target xmlns:t="https://services.rosminzdrav.ru/MedStaff" action="replace" type="custom" xpath="//t:Employee/t:Sex"/>
</enrich>
Use filter mediator and check for condition
2.how to add a new element?
You can use, payload/enrich/xslt mediators based on your requirements