public void initializeDescriptor(XMLDescriptor descriptor) { AbstractSession theSession = (AbstractSession) getXmlContext().getSession(0); // do initialization for new descriptor; descriptor.preInitialize(theSession); descriptor.initialize(theSession); descriptor.postInitialize(theSession); descriptor.getObjectBuilder().initializePrimaryKey(theSession); getXmlContext().storeXMLDescriptorByQName(descriptor); }