C# Problem with protection level.

Hello.

I have problem with the protection level of c#

I have following code:

using UnityEngine;
using System.Collections;
using System.Xml;

public class ReadingWritingConfig : MonoBehaviour {

    // Use this for initialization
    void saveConfigXML() {
        XmlDocument doc = new XmlDocument();
        XmlNode myRoot;
        myRoot = doc.CreateElement("ServerConfig");
        doc.AppendChild(myRoot);
        doc.Save(@"c:	est.xml");
    }
}

Now I try to access with javascript to the method:

if (GUILayout.Button ("Safe Config")){
var xmlreadwrite  : ReadingWritingConfig;
xmlreadwrite = new ReadingWritingConfig();
xmlreadwrite.saveConfigXML();
}

But I get the error

ReadingWritingConfig.saveConfigXML' is inaccessible due to its protection level.

When I set saveConfigXML to public its working.. but I dont want it to be public.

So what is the problem? Ive created a new object that is accessing its own method.. Why I get protection level error?

And yes I have the c# file in correct compile order (Standart Assets)... Thanks

Your function needs to be public, that's all

public void SaveConfigXML() {

The default protection level for javascript is public, but it's private in c#