Inserting code with XJC+xsd+jxb using the options " -Xinject-code -extension "

Solution 1:

Please try /xs:schema/xs:element[@name='MyItem']/xs:complexType.