<class name="myclass"> <attribute name="foo" value="1"/> <attribute name="thing" value="foo + 4" when="always"/> <attribute name="bar"/> <method event="oninit"> this.bar= true; this.foo = 4; </method> <method name="dothis"> if (bar) { this.setAttribute("foo", 6); } </method> </class>