Program: 67798
Project: 67798
Buggy source:
public void marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
    if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
      value=((XMLConverter)xmlCompositeDirectCollectionMapping.getValueConverter()).convertObjectValueToDataValue(value,session,marshalRecord.getMarshaller());
    }
 else {
      value=xmlCompositeDirectCollectionMapping.getValueConverter().convertObjectValueToDataValue(value,session);
    }
  }
  XMLField xmlField=(XMLField)xmlCompositeDirectCollectionMapping.getField();
  QName schemaType=getSchemaType(xmlField,value,session);
  String stringValue=getValueToWrite(schemaType,value,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager());
  if (null != stringValue) {
    marshalRecord.openStartElement(xPathFragment,namespaceResolver);
    XPathFragment nextFragment=xPathFragment.getNextFragment();
    if (nextFragment.isAttribute()) {
      marshalRecord.attribute(nextFragment,namespaceResolver,stringValue);
      marshalRecord.closeStartElement();
    }
 else {
      if (xmlField.isTypedTextField()) {
        String typeQName=namespaceResolver.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL) + "String_Node_Str";
        String schemaTypePrefix=namespaceResolver.resolveNamespaceURI(schemaType.getNamespaceURI());
        marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL,schemaType.getLocalPart(),typeQName,schemaTypePrefix + ':' + schemaType.getLocalPart());
      }
      marshalRecord.closeStartElement();
      if (xmlCompositeDirectCollectionMapping.isCDATA()) {
        marshalRecord.cdata(stringValue);
      }
 else {
        marshalRecord.characters(stringValue);
      }
    }
    marshalRecord.endElement(xPathFragment,namespaceResolver);
  }
}

Fixed version (ground truth):
public void marshalSingleValue(XPathFragment xPathFragment,MarshalRecord marshalRecord,Object object,Object value,AbstractSession session,NamespaceResolver namespaceResolver,MarshalContext marshalContext){
  if (xmlCompositeDirectCollectionMapping.hasValueConverter()) {
    if (xmlCompositeDirectCollectionMapping.getValueConverter() instanceof XMLConverter) {
      value=((XMLConverter)xmlCompositeDirectCollectionMapping.getValueConverter()).convertObjectValueToDataValue(value,session,marshalRecord.getMarshaller());
    }
 else {
      value=xmlCompositeDirectCollectionMapping.getValueConverter().convertObjectValueToDataValue(value,session);
    }
  }
  XMLField xmlField=(XMLField)xmlCompositeDirectCollectionMapping.getField();
  QName schemaType=getSchemaType(xmlField,value,session);
  String stringValue=getValueToWrite(schemaType,value,(XMLConversionManager)session.getDatasourcePlatform().getConversionManager(),namespaceResolver);
  if (null != stringValue) {
    marshalRecord.openStartElement(xPathFragment,namespaceResolver);
    XPathFragment nextFragment=xPathFragment.getNextFragment();
    if (nextFragment.isAttribute()) {
      marshalRecord.attribute(nextFragment,namespaceResolver,stringValue);
      marshalRecord.closeStartElement();
    }
 else {
      if (xmlField.isTypedTextField()) {
        String typeQName=namespaceResolver.resolveNamespaceURI(XMLConstants.SCHEMA_INSTANCE_URL) + "String_Node_Str";
        String schemaTypePrefix=namespaceResolver.resolveNamespaceURI(schemaType.getNamespaceURI());
        marshalRecord.attribute(XMLConstants.SCHEMA_INSTANCE_URL,schemaType.getLocalPart(),typeQName,schemaTypePrefix + ':' + schemaType.getLocalPart());
      }
      marshalRecord.closeStartElement();
      if (xmlCompositeDirectCollectionMapping.isCDATA()) {
        marshalRecord.cdata(stringValue);
      }
 else {
        marshalRecord.characters(stringValue);
      }
    }
    marshalRecord.endElement(xPathFragment,namespaceResolver);
  }
}