java - Jaxb Maven plugins and represent null element as null, not as instance -


scenario, xml example:

<outer>     <inner /> </outer> 

i need use mavens jaxb plugin, do, long generate xml xsd. schema states outer element must occur once, , inner element has minoccurs 0. inner element has attribute, minoccurs 0. element having more value makes class. i'm receiving example xml, , after doing unmarshalling, saves inner element "empty instance" , not null. when i'm doing marshalling again, validation errors because inner element not ignored though it's "null" in sense.

what need way make these elements /> ending , nothing else read null, wont marshalled or validated, ignored, dropped, unless specified occur. xml marshalled simply:

<outer /> 

i read there ways achieve modifying xml classes ( create null object unmarshalling empty element jaxb , jaxb empty element unmarshalling), since xml classes generated maven jaxb plugin, modifications ofcourse overwritten every time classes generated.

is there way achieve jaxb maven plugins or there other way apply changes on top of generated codes managed? other suggestions welcomed well. received xml cannot modified , result must way described. if there can added schema behavior acceptable well.