What I wanted: I have a collection (dictionary) of custom objects and I wanted all of them to be logged using my logging method.
XmlSerializer xs = new XmlSerializer(typeof(CustomObject));
//enumerate through each key value pair and log them.
foreach(CustomObject csObj in this._CustomCollection)
//XML output to memory stream
MemoryStream ms = new MemoryStream();
//Serialize each node of the paragraph test
xs.Serialize(ms, csObj );
//Get the string from the memory stream buffer
UTF8Encoding encoding = new UTF8Encoding();
String myString = encoding.GetString(ms.GetBuffer());
//Call your logging mechanism