where to put XML files in unity project ?

Hi, i have a problem here about xml files… it seems unity don’t compile project as like in unity editor… i have xml on path

Assets/Scripts/Models/data.xml

so i load my XDocument with that xml path. it works fine on editor but error when i build. please help me :s is there a way to load xml from that path ?

You should put your xml in any folder called Resources and access the content by

Resources.Load<TextAsset>("filnamewithoutextension");

Or you could put your xml in Assets/StreamingAssets and access the file via

Application.streamingAssetPath + "/yourxml.xml";