I need a function to create a xml file so i can produce my cardgame data to xml
and I need a function to load a xml file to read my cardeffect.xml and able to access it using another gameObject.
Add your XML file to the project. It will be a TextAsset.
Define a class with a [System.Serialized] tag at the top.
Use XmlSerializer.Deserialize (as shown in the bottom of this page) to read the XML TextAsset into an instance of the class.
We can point you in the right direction, but unityAnswers isn’t the place to ask for someone to write code for you. If you want to hire someone to write the code for you, you can post in the Commercial: Job Offering forum.
Check into the load/save package that is on the unifycommunity, it is written in C# (and JS) and can help you understand what you might need to do. It should provide a framework for everything you’re trying to do, and is modifiable in case you need more.