void ExportText(CodeAttributeDeclarationCollection metadata, TypeDesc typeDesc, string dataType) {
CodeAttributeDeclaration attribute = new CodeAttributeDeclaration(typeof(XmlTextAttribute).FullName);
if (typeDesc != null) {
attribute.Arguments.Add(new CodeAttributeArgument(new CodeTypeOfExpression(typeDesc.FullName)));
}
if (dataType != null) {
attribute.Arguments.Add(new CodeAttributeArgument("DataType", new CodePrimitiveExpression(dataType)));
}
metadata.Add(attribute);
}