I need to force the xsi:type generation on fields because the xml will be deserialized into a different object through a xsl transformation sheet. Datatypes are defined with XSD schemas, anyone can use jaxb to generate classes and send data to the endpoint but the endpoint is completely dynamic and uses a special DTO containing common data fields and some Object maps which will hold the dynamic data fields.
For example this is what I get:
<?xml version="1.0" encoding="UTF-8"?>
<myp:documento xmlns:myp="mypns" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<myp:sys_name>name</myp:sys_name>
<myp:sys_path>path</myp:sys_path>
<myp:sys_type>type</myp:sys_type>
<myp:dyn_date_modified>2015-09-30T11:13:10.810+02:00</myp:dyn_date_modified>
</myp:documento>
this is what I need:
<?xml version="1.0" encoding="UTF-8"?>
<myp:documento xmlns:myp="mypns" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<myp:sys_name>name</myp:sys_name>
<myp:sys_path>path</myp:sys_path>
<myp:sys_type>type</myp:sys_type>
<myp:dyn_date_modified xsi:type="xs:dateTime">2015-09-30T11:13:10.810+02:00</myp:dyn_date_modified>
</myp:documento>
because the attribute dyn_date_modified
will be deserialized into the dynamic Object map..
Let me know if you need more detail.