Calling Functions from XML


I’m building an XML accordion menu as an external class, and I want to be able to include a function reference in the external XML file, with the function body sitting in a class file. I want to be able to call that function say with a click on one of the menu items.

I’ve tried various approaches, but generally get type errors or a “Function Body” not supported error if I cast the XML data as a function.

Is there anyway to have a function call say, “testFunction” in an XML file, then with a click on a button, call that function which has its body sitting on say the main timeline?