saving gameobject script references to xml

how do i save a gameobject reference to xml? like i have a variable in my C# script that holds a gameobject how do i save that to an xml script. is it the same for a texture?

Check this out:

http://wiki.unity3d.com/index.php?title=Saving_and_Loading_Data:_XmlSerializer