Currently, the Castor XML code generator does not create any special validation logic for <xsd:ID> typed elements/attributes. As a result, it is currently impossible to assess that ...
a) a content element typed with <xsd:ID> is not empty.
b) there's more than one such content element with an identical value.
The idea is to create a new IdValidator and modify the XML code generator to make sure that this new validator is called accordingly.