Program: 67273
Project: 67273
Buggy source:
private Object getNonNodeValueToWrite(Object value,XMLField xmlField,AbstractSession session){
  if (this == value) {
    return this;
  }
  QName schemaType=null;
  if (xmlField.getLeafElementType() != null) {
    schemaType=xmlField.getLeafElementType();
  }
 else   if (xmlField.isUnionField()) {
    return getValueToWriteForUnion((XMLUnionField)xmlField,value,session);
  }
 else   if (xmlField.isTypedTextField()) {
    schemaType=xmlField.getXMLType(value.getClass());
  }
 else   if (xmlField.getSchemaType() != null) {
    schemaType=xmlField.getSchemaType();
  }
  if (value instanceof List) {
    if (xmlField.usesSingleNode()) {
      String returnString="String_Node_Str";
      for (int i=0; i < ((List)value).size(); i++) {
        Object nextItem=((List)value).get(i);
        String nextConvertedItem=(String)((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).convertObject(nextItem,ClassConstants.STRING,schemaType);
        returnString+=nextConvertedItem;
        if (i < (((List)value).size() - 1)) {
          returnString+="String_Node_Str";
        }
      }
      return returnString;
    }
 else {
      ArrayList items=new ArrayList(((List)value).size());
      for (int index=0; index < ((List)value).size(); index++) {
        Object nextItem=((List)value).get(index);
        if (nextItem instanceof Node) {
          items.add(nextItem);
        }
 else {
          if (schemaType != null && schemaType.equals(XMLConstants.QNAME_QNAME)) {
            String nextConvertedItem=getStringForQName((QName)nextItem,getNamespaceResolverForField(xmlField));
            items.add(nextConvertedItem);
          }
 else {
            String nextConvertedItem=(String)((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).convertObject(nextItem,ClassConstants.STRING,schemaType);
            items.add(nextConvertedItem);
          }
        }
      }
      return items;
    }
  }
 else {
    if (schemaType != null && schemaType.equals(XMLConstants.QNAME_QNAME)) {
      return getStringForQName((QName)value,getNamespaceResolverForField(xmlField));
    }
    return ((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).convertObject(value,ClassConstants.STRING,schemaType);
  }
}

Fixed version (ground truth):
private Object getNonNodeValueToWrite(Object value,XMLField xmlField,AbstractSession session){
  if (this == value) {
    return this;
  }
  QName schemaType=null;
  if (xmlField.getLeafElementType() != null) {
    schemaType=xmlField.getLeafElementType();
  }
 else   if (xmlField.isUnionField()) {
    return getValueToWriteForUnion((XMLUnionField)xmlField,value,session);
  }
 else   if (xmlField.isTypedTextField()) {
    schemaType=xmlField.getXMLType(value.getClass());
  }
 else   if (xmlField.getSchemaType() != null) {
    schemaType=xmlField.getSchemaType();
  }
  if (value instanceof List) {
    if (xmlField.usesSingleNode()) {
      String returnString="String_Node_Str";
      for (int i=0; i < ((List)value).size(); i++) {
        Object nextItem=((List)value).get(i);
        String nextConvertedItem=null;
        if (schemaType != null && schemaType.equals(XMLConstants.QNAME_QNAME)) {
          nextConvertedItem=getStringForQName((QName)nextItem,getNamespaceResolverForField(xmlField));
        }
 else {
          nextConvertedItem=(String)((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).convertObject(nextItem,ClassConstants.STRING,schemaType);
        }
        returnString+=nextConvertedItem;
        if (i < (((List)value).size() - 1)) {
          returnString+="String_Node_Str";
        }
      }
      return returnString;
    }
 else {
      ArrayList items=new ArrayList(((List)value).size());
      for (int index=0; index < ((List)value).size(); index++) {
        Object nextItem=((List)value).get(index);
        if (nextItem instanceof Node) {
          items.add(nextItem);
        }
 else {
          if (schemaType != null && schemaType.equals(XMLConstants.QNAME_QNAME)) {
            String nextConvertedItem=getStringForQName((QName)nextItem,getNamespaceResolverForField(xmlField));
            items.add(nextConvertedItem);
          }
 else {
            String nextConvertedItem=(String)((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).convertObject(nextItem,ClassConstants.STRING,schemaType);
            items.add(nextConvertedItem);
          }
        }
      }
      return items;
    }
  }
 else {
    if (schemaType != null && schemaType.equals(XMLConstants.QNAME_QNAME)) {
      return getStringForQName((QName)value,getNamespaceResolverForField(xmlField));
    }
    return ((XMLConversionManager)session.getDatasourcePlatform().getConversionManager()).convertObject(value,ClassConstants.STRING,schemaType);
  }
}