Here is an example based on the Advanced Tutorial, Learning Boo Kung-Fu.

Note, you have to compile this to an exe and then run it. It won't work in booi, because types in dynamically generated assemblies can't be serialized apparently.

import System.Xml from System.Xml
import System.Drawing from System.Drawing
import System.ComponentModel
import System.Xml.Serialization
import System.IO
import System

class Ninja:
	public Name as string
	public Style as string
	public Speed as int
	public Strength as int
	public Stamina as int

	//problem serializing Colors:
	_color as Color
	[XmlIgnore] //don't serialize this, we'll using StringColor instead
	Color as Color:
			return _color
			_color = value

	[Browsable(false)] //so this property isn't used in an IDE
	public StringColor as string:
			return ColorTranslator.ToHtml(_color)
			_color = ColorTranslator.FromHtml(value)

	def ToString():
		return "You see $Name, a ninja of the $Style with the stats $Strength/$Stamina/$Speed. He is $Color."


ninja = Ninja(Name:"Hiyo", Style:"Drunken Monkey",
             Speed:77, Strength:88, Stamina:99,

print ninja

s = XmlSerializer(typeof(Ninja))
//convert to xml, print it out:
s.Serialize(System.Console.Out, ninja)

//to serialize to a file:
//using out = StreamWriter(filename):
//	s.Serialize(out, ninja)

//to serialize to a string variable:
//s as string
//using out = StringWriter(s):
//	s.Serialize(out, ninja)

//DESERIALIZING FROM XML (with earlier example xml)
xml = """
<Ninja color="#FF00FF" name="John Kho Kawn" style="Crazy Martial Arts" strength="71" speed = "74" stamina = "65" />

s = XmlSerializer(typeof(Ninja))
reader = StringReader( xml )
newninja as Ninja = s.Deserialize( reader )
print newninja

For more info on XML Serialization in .NET and Mono, see these tutorials:

Non-XML (Binary) Serialization

This is useful when you really just want to store and retrieve an object like a dictionary/hashtable, and you don't need to use XML.

import System.IO
import System.Runtime.Serialization.Formatters.Binary

def savetofile(obj, filename as string):
	using stream = FileStream(filename, FileMode.OpenOrCreate ,FileAccess.Write):
		savetostream(obj, stream)

def savetomemory(obj) as (byte):
	using stream = MemoryStream():
		savetostream(obj, stream)
	return stream.GetBuffer()

def savetostream(obj, str as Stream): //see also CryptoStream
	BinaryFormatter().Serialize(str, obj)

def loadfromfile(filename as string) as object:
	using stream = FileStream(filename, FileMode.Open):
		return loadfromstream(stream)

def loadfrommemory(buffer as (byte)) as object:
	using stream = MemoryStream(buffer):
		return loadfromstream(stream)

def loadfromstream(str as Stream) as object:
	return BinaryFormatter().Deserialize(str)

d = {"one": "item", "two": "another item"}

print "memory example..."
saved = savetomemory(d)
d2 as Hash = loadfrommemory(saved)
for key in d2.Keys:
	print key, ":", d2[key]

print "\nfile example..."
filename = "saved-dict.dat"
savetofile(d, filename)
d3 as Hash = loadfromfile(filename)
for key in d3.Keys:
	print key, ":", d3[key]

See also: