Does your service have a WSDL?
Here is an idea. Before processing the xml store it is a string and replace "ns3:value xsi:type=" with
"ns3:valueEnum" using replaceAll. Then map both cases of the response and mark value and valueEnum as nullable.
<ns3:Custom>
<ns3:key>testType</ns3:key>
<ns3:valueEnum xsi:type="ns3:ArrayOfEnumOptionId">
<ns3:EnumOptionId xsi:type="ns3:EnumOptionId">
<ns3:id xsi:type="xsd:string">Type1</ns3:id>
</ns3:EnumOptionId>
<ns3:EnumOptionId xsi:type="ns3:EnumOptionId">
<ns3:id xsi:type="xsd:string">Type2</ns3:id>
</ns3:EnumOptionId>
</ns3:valueEnum>
<ns3:value > Test </ns3:value>
</ns3:Custom>
Afterward you can check which format was received by checking for empty.