C# code to serialize an object.  Pass in the object you want to serialize.