XML Serialization of Prefab ID in Editor

I have a editor extension that allows my Skill objects to be created in the inspector.

They have a list of objects that have various values, one of them being a prefab reference.

I want to be able to export these objects that are created in the unity editor as XML.

i have the following code

        [Serializable]
        [XmlRoot("SkillList", Namespace = "http://www.cpandl.com",
        IsNullable = false)]
        public class EditorSkillList
            {
            [XmlArrayAttribute("Skills")]
            public List<Skill> Skills = new List<Skill>();

The issue lies in one of the Skill objects contains and object that has a reference to a prefab.

how do i store this prefab reference in xml?

You store its path?

Prefab instances cannot be stored in an xml file directly.

It all depends on what you want the reference for. If you just want it to be displayed then the path to the object might be the right thing to store (Using AssetDatabase.GetAssetPath)

If you want to reload it during editor time you can also use the AssetDatabase to recover the asset reference from your stored path.

If you want to reload it at runtime using Resources.Load and deriving the resource path from GetAssetPath might be your best bet.