' Convert a DataSet into an Xml ' This functions make it so the schema is included ' expO1 DataSet Public Function DataSetToXml(ByVal toDataSet As DataSet) As String Dim loStringWriter As StringWriter = New StringWriter() ' Adjust the dataset to avoid null values toDataSet = AdjustDataSetToAvoidNullValue(toDataSet) toDataSet.WriteXml(loStringWriter, XmlWriteMode.WriteSchema) Return loStringWriter.ToString End FunctionHowever, once everything is in Xml, for those empty fields, I would like them to be trimmed. Because, in the Xml, this is what I would like to have:
<NewDataSet> <Temp> <MyField /> </Temp> </NewDataSet>instead of:
<NewDataSet> <Temp> <MyField> </MyField> </Temp> </NewDataSet>How can I do that?