if (valueAsText.length() > MAX_ATTRIBUTE_LENGTH)
if ((valueAsText.length() > MAX_ATTRIBUTE_LENGTH) || containsSpecialCharacters(valueAsText))
    public void write(SqlDynaBean bean) throws DataWriterException    {        SqlDynaClass dynaClass   = (SqlDynaClass)bean.getDynaClass();        Table        table       = dynaClass.getTable();        HashMap      subElements = new HashMap();        try        {            indentIfPrettyPrinting(1);            _writer.writeStartElement(table.getName());            for (int idx = 0; idx < table.getColumnCount(); idx++)            {                Column           column      = table.getColumn(idx);                Object           value       = bean.get(column.getName());                SqlTypeConverter converter   = _converterConf.getRegisteredConverter(table, column);                String           valueAsText = null;                if (converter == null)                {                    if (value != null)                    {                        valueAsText = value.toString();                    }                }                else                {                    valueAsText = converter.convertToString(value, column.getTypeCode());                }                if (valueAsText != null)                {                    if (valueAsText.length() > MAX_ATTRIBUTE_LENGTH)                    {                        // we defer writing the sub elements                        subElements.put(column.getName(), valueAsText);                    }                    else                    {                        _writer.writeAttribute(column.getName(), valueAsText);                    }                }            }            if (!subElements.isEmpty())            {                for (Iterator it = subElements.entrySet().iterator(); it.hasNext();)                {                    Map.Entry entry = (Map.Entry)it.next();                            printlnIfPrettyPrinting();                    indentIfPrettyPrinting(2);                    _writer.writeStartElement(entry.getKey().toString());                    _writer.writeCData(entry.getValue().toString());                    _writer.writeEndElement();                }                printlnIfPrettyPrinting();                indentIfPrettyPrinting(1);            }            _writer.writeEndElement();            printlnIfPrettyPrinting();        }        catch (XMLStreamException ex)        {            throw new DataWriterException(ex);        }        catch (ConversionException ex)        {            throw new DataWriterException(ex);        }    }