@Override
public void writeObject( Object object, final MessageWriter writer, final Context context )
throws DatabindingException
{
ValueComposite composite = (ValueComposite) object;
writer.writeXsiType( NamespaceUtil.convertJavaTypeToQName(
first( Qi4j.FUNCTION_DESCRIPTOR_FOR.map( composite ).types() ) ) );
AssociationStateHolder state = spi.stateOf( composite );
for( Property<?> property : state.properties() )
{
Object value = property.get();
AegisType type = null;
if( value instanceof ValueComposite )
{
ValueComposite compositeValue = (ValueComposite) value;
type = getTypeMapping().getType( NamespaceUtil.convertJavaTypeToQName(
first( Qi4j.FUNCTION_DESCRIPTOR_FOR.map( compositeValue ).types() ) ) );
}
else if( value != null )
{