diff --git a/.bzrignore b/.bzrignore
index 2411d31664cddac4c1bbaeb2231d71ca4dd3d93a..68c2c268aa93816fc9b57bbe4d64e5bd9c8ab87f 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -16,3 +16,8 @@ SchemaCompile.jar
 examples/configForm/config-sheet.html
 examples/x3d/x3d_demo.x3d
 examples/x3d/X3DAST
+GeneratedAspects.jrag
+Parser.java
+PrettyPrint.java
+xdf.ast
+xdf.jjt
diff --git a/examples/xdf/build.xml b/examples/xdf/build.xml
new file mode 100644
index 0000000000000000000000000000000000000000..41249901045fa39ccb2c2c6139bca52246ff9977
--- /dev/null
+++ b/examples/xdf/build.xml
@@ -0,0 +1,113 @@
+<!--
+    Targets for working from terminal window:
+    build (default) - generates java files and compiles them
+    clean           - removes all generated files and class files
+    Targets for working from Eclipse:
+    gen             - generates java files
+    genClean        - removes all generated files and their class files
+  -->
+<project name="XDF compiler" default="build" basedir=".">
+
+  <!-- "package" is the directory where generated files will be stored -->
+  <property name="package" value="AST"/>
+
+  <!-- "tools" is the directory where generators and libraries are located. -->
+  <property name="tools" value="../../tools"/>
+
+  <property name="javacc.home" value="../../tools/javacc-4.0"/>
+  
+  <property name="parser.name" value="XmlParser"/>
+  
+  <!-- "jflex" is an ant task class for the scanner generator in JFlex.jar -->
+<!--   <taskdef name="jflex" classname="JFlex.anttask.JFlexTask" classpath="tools/JFlex.jar"/> -->
+  <!-- "beaver" is an ant task class for the parser generator in beaver.jar -->
+<!--   <taskdef name="beaver" classname="beaver.comp.run.AntTask" classpath="tools/beaver.jar"/> -->
+  <!-- "jastadd" is an ant task class in jastadd2.jar -->
+  <taskdef name="jastadd" classname="jastadd.JastAddTask" classpath="../../tools/jastadd2.jar"/>
+
+  <!-- compile sources -->
+  <target name="build" depends="gen">
+	  <javac  debug="true" nowarn="true" srcdir="." includes="**/*.java" excludes="tools/**" classpath=".:${tools}/beaver-rt.jar:${tools}/junit.jar"/>
+  </target>
+  
+  <!-- generate compiler source files -->
+  <target name="gen" description="Generate compiler source files">
+    <!-- create AST node types and weave aspect modules -->
+    <echo message = "Running JastAdd"/>
+<!--     <jastadd package="${package}" rewrite="true" beaver="true" novisitcheck="true"> -->
+    <jastadd package="${package}" grammar="${parser.name}" rewrite="true" jjtree="true">
+      <fileset dir=".">
+	<include name="*.ast"/>
+	<include name="*.jrag"/>
+	<include name="*.jadd"/>
+      </fileset>
+    </jastadd>
+    <jjtree 
+       target="xdf.jjt" 
+       outputdirectory="${package}" 
+       javacchome="${javacc.home}"
+       buildnodefiles="true"
+       static="false"
+       multi="true"
+       visitor="true"
+       nodedefaultvoid="true"
+       nodeprefix='""'
+       nodepackage="${package}"
+       />
+    <javacc
+       target="${package}/xdf.jj"
+       outputdirectory="${package}"
+       javacchome="${javacc.home}"
+       buildparser="true"
+       buildtokenmanager="true"
+       static="false"
+       />
+
+    <!-- generate the scanner -->
+<!--     <echo message = "Running jflex"/> -->
+<!--     <jflex file="parser/java14.flex" outdir="parser" nobak="yes"/> -->
+    <!-- generate the scanner -->
+<!--     <jflex file="parser/unicode.flex" outdir="parser" nobak="yes"/> -->
+    <!-- generate the parser phase 1, create a full .lalr specification from fragments-->
+<!--     <echo message = "Running parser phase 1"/> -->
+<!--     <concat destfile="parser/JavaParser.all" binary="true"> -->
+<!--       <fileset dir="."> -->
+<!-- 	<include name="parser/java14.parser"/> -->
+<!--       </fileset> -->
+<!--     </concat> -->
+    <!-- generate the parser phase 2, translating .lalr to .beaver -->
+<!--     <java classpath="${tools}/proj.jar:${tools}/beaver-rt.jar" classname="Main"> -->
+<!--       <arg line="parser/JavaParser.all parser/JavaParser.beaver"/> -->
+<!--     </java> -->
+    <!-- generate the parser phase 3, translating .beaver to .java -->
+<!--     <beaver file="parser/JavaParser.beaver" terminalNames="yes" compress="no" useSwitch="yes"/> -->
+  </target>
+
+<!--   <target name="test" depends="build"> -->
+<!--     <java classname="GenCompiler" classpath="."> -->
+<!--       <arg value="GripperOntology_experimental3.owl" /> -->
+<!--     </java> -->
+<!--   </target> -->
+
+  <!-- remove generated source files and .class files -->
+  <target name="clean" depends="cleanGen">
+    <!-- delete all .class files recursively -->
+    <delete>
+      <fileset dir="." includes="**/*.class" excludes="beaver/*.class"/>
+    </delete>
+  </target>
+
+<!--   <target name="jar" depends="build"> -->
+<!--     <jar destfile="X3DCompiler.jar" basedir="." includes="**/*.class" excludes="test/**"> -->
+<!--       <manifest> -->
+<!-- 	<attribute name="Main-Class" value="GenOntology"/> -->
+<!--       </manifest> -->
+<!--     </jar> -->
+<!--   </target> -->
+
+  <!-- remove generated source files and their .class files -->
+  <target name="cleanGen">
+    <delete dir="${package}"/>
+  </target>
+</project>
+
diff --git a/examples/xdf/sdftest.xdf b/examples/xdf/sdftest.xdf
new file mode 100644
index 0000000000000000000000000000000000000000..de0a19c9e39bb3e8e1d41f63d19170c5f8460141
--- /dev/null
+++ b/examples/xdf/sdftest.xdf
@@ -0,0 +1,425 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<XDF name="sdftest">
+    <Instance id="$id_n$0">
+        <Note kind="UID" value="art_Source_txt_0"/>
+        <Note kind="instanceHierarchy"/>
+        <Parameter name="fileName">
+            <Expr kind="Literal" literal-kind="String" value="./in.txt"/>
+        </Parameter>
+        <Class name="art_Source_txt"/>
+        <Note kind="sourceLoaded" value="true"/>
+        <Note kind="className" value="art_Source_txt"/>
+        <Actor name="art_Source_txt">
+            <Import kind="single" text-begin-col="1" text-begin-line="1" text-end-col="20"
+                    text-end-line="1">
+                <QID name="java.io.File">
+                    <ID name="java"/>
+                    <ID name="io"/>
+                    <ID name="File"/>
+                </QID>
+            </Import>
+            <Import kind="single" text-begin-col="1" text-begin-line="2" text-end-col="25"
+                    text-end-line="2">
+                <QID name="java.util.Scanner">
+                    <ID name="java"/>
+                    <ID name="util"/>
+                    <ID name="Scanner"/>
+                </QID>
+            </Import>
+            <Decl kind="Parameter" name="fileName">
+                <Type name="string"/>
+            </Decl>
+            <Port kind="Output" name="Out">
+                <Type name="int"/>
+            </Port>
+            <Decl assignable="Yes" kind="Variable" name="input" text-begin-col=""
+                  text-begin-line=""
+                  text-end-col="34"
+                  text-end-line="8">
+                <Type name="File"/>
+                <Expr kind="Let">
+                    <Expr kind="Application" text-begin-col="21" text-begin-line="8" text-end-col="34"
+                          text-end-line="8">
+                        <Expr kind="Var" name="File" text-begin-col="21" text-begin-line="8"
+                              text-end-col="21"
+                              text-end-line="8"/>
+                        <Args>
+                            <Expr kind="Var" name="fileName" text-begin-col="26" text-begin-line="8"
+                                  text-end-col="26"
+                                  text-end-line="8"/>
+                        </Args>
+                    </Expr>
+                </Expr>
+            </Decl>
+            <Decl assignable="Yes" kind="Variable" name="scanner" text-begin-col=""
+                  text-begin-line=""
+                  text-end-col="39"
+                  text-end-line="9">
+                <Type name="Scanner"/>
+                <Expr kind="Let">
+                    <Expr kind="Application" text-begin-col="26" text-begin-line="9" text-end-col="39"
+                          text-end-line="9">
+                        <Expr kind="Var" name="Scanner" text-begin-col="26" text-begin-line="9"
+                              text-end-col="26"
+                              text-end-line="9"/>
+                        <Args>
+                            <Expr kind="Var" name="input" text-begin-col="34" text-begin-line="9"
+                                  text-end-col="34"
+                                  text-end-line="9"/>
+                        </Args>
+                    </Expr>
+                </Expr>
+            </Decl>
+            <Action text-begin-col="2" text-begin-line="11" text-end-col="2" text-end-line="13">
+                <Output port="Out" text-begin-col="13" text-begin-line="11" text-end-col="31"
+                        text-end-line="11">
+                    <Expr kind="Let">
+                        <Expr kind="Application" text-begin-col="14" text-begin-line="11" text-end-col="30"
+                              text-end-line="11">
+                            <Expr kind="Entry" name="nextInt" text-begin-col="14" text-begin-line="11"
+                                  text-end-col="22"
+                                  text-end-line="11">
+                                <Expr kind="Var" name="scanner" text-begin-col="14" text-begin-line="11"
+                                      text-end-col="14"
+                                      text-end-line="11"/>
+                            </Expr>
+                            <Args/>
+                        </Expr>
+                    </Expr>
+                </Output>
+                <Guards>
+                    <Expr kind="Let">
+                        <Expr kind="Application" text-begin-col="15" text-begin-line="12" text-end-col="34"
+                              text-end-line="12">
+                            <Expr kind="Entry" name="hasNextInt" text-begin-col="15" text-begin-line="12"
+                                  text-end-col="23"
+                                  text-end-line="12">
+                                <Expr kind="Var" name="scanner" text-begin-col="15" text-begin-line="12"
+                                      text-end-col="15"
+                                      text-end-line="12"/>
+                            </Expr>
+                            <Args/>
+                        </Expr>
+                    </Expr>
+                </Guards>
+            </Action>
+            <Note kind="filepath" value="/home/csandersn/work/actors/example//art_Source_txt.cal"/>
+        </Actor>
+        <Attribute kind="Value" name="clockDomain">
+            <Expr kind="Literal" literal-kind="String" value="CLK"/>
+        </Attribute>
+    </Instance>
+    <Instance id="$id_n$1">
+        <Note kind="UID" value="AddOne_0"/>
+        <Note kind="instanceHierarchy"/>
+        <Class name="AddOne"/>
+        <Note kind="sourceLoaded" value="true"/>
+        <Note kind="className" value="AddOne"/>
+        <Actor name="AddOne">
+            <Port kind="Input" name="In">
+                <Type name="int"/>
+            </Port>
+            <Port kind="Output" name="Out">
+                <Type name="int"/>
+            </Port>
+            <Action text-begin-col="7" text-begin-line="3" text-end-col="28" text-end-line="3">
+                <Input kind="Elements" port="In" text-begin-col="14" text-begin-line="3"
+                       text-end-col="16"
+                       text-end-line="3">
+                    <Decl kind="Input" name="$local$x">
+                        <Type name="int"/>
+                    </Decl>
+                </Input>
+                <Output port="Out" text-begin-col="22" text-begin-line="3" text-end-col="26"
+                        text-end-line="3">
+                    <Expr kind="Let">
+                        <Expr kind="BinOpSeq" text-begin-col="23" text-begin-line="3" text-end-col="25"
+                              text-end-line="3">
+                            <Expr kind="Var" name="$local$x" text-begin-col="23" text-begin-line="3"
+                                  text-end-col="23"
+                                  text-end-line="3"/>
+                            <Op name="+"/>
+                            <Expr kind="Literal" literal-kind="Integer" text-begin-col="25" text-begin-line="3"
+                                  text-end-col="25"
+                                  text-end-line="3"
+                                  value="1"/>
+                        </Expr>
+                    </Expr>
+                </Output>
+            </Action>
+            <Note kind="filepath" value="/home/csandersn/work/actors/example//AddOne.cal"/>
+        </Actor>
+        <Attribute kind="Value" name="clockDomain">
+            <Expr kind="Literal" literal-kind="String" value="CLK"/>
+        </Attribute>
+    </Instance>
+    <Instance id="$id_n$2">
+        <Note kind="UID" value="Double_0"/>
+        <Note kind="instanceHierarchy"/>
+        <Class name="Double"/>
+        <Note kind="sourceLoaded" value="true"/>
+        <Note kind="className" value="Double"/>
+        <Actor name="Double">
+            <Port kind="Input" name="In">
+                <Type name="int"/>
+            </Port>
+            <Port kind="Output" name="Out">
+                <Type name="int"/>
+            </Port>
+            <Action text-begin-col="7" text-begin-line="3" text-end-col="28" text-end-line="3">
+                <Input kind="Elements" port="In" text-begin-col="14" text-begin-line="3"
+                       text-end-col="16"
+                       text-end-line="3">
+                    <Decl kind="Input" name="$local$x">
+                        <Type name="int"/>
+                    </Decl>
+                </Input>
+                <Output port="Out" text-begin-col="22" text-begin-line="3" text-end-col="26"
+                        text-end-line="3">
+                    <Expr kind="Let">
+                        <Expr kind="BinOpSeq" text-begin-col="23" text-begin-line="3" text-end-col="25"
+                              text-end-line="3">
+                            <Expr kind="Var" name="$local$x" text-begin-col="23" text-begin-line="3"
+                                  text-end-col="23"
+                                  text-end-line="3"/>
+                            <Op name="*"/>
+                            <Expr kind="Literal" literal-kind="Integer" text-begin-col="25" text-begin-line="3"
+                                  text-end-col="25"
+                                  text-end-line="3"
+                                  value="2"/>
+                        </Expr>
+                    </Expr>
+                </Output>
+            </Action>
+            <Note kind="filepath" value="/home/csandersn/work/actors/example//Double.cal"/>
+        </Actor>
+        <Attribute kind="Value" name="clockDomain">
+            <Expr kind="Literal" literal-kind="String" value="CLK"/>
+        </Attribute>
+    </Instance>
+    <Instance id="$id_n$3">
+        <Note kind="UID" value="SubOne_0"/>
+        <Note kind="instanceHierarchy"/>
+        <Class name="SubOne"/>
+        <Note kind="sourceLoaded" value="true"/>
+        <Note kind="className" value="SubOne"/>
+        <Actor name="SubOne">
+            <Port kind="Input" name="In">
+                <Type name="int"/>
+            </Port>
+            <Port kind="Output" name="Out">
+                <Type name="int"/>
+            </Port>
+            <Action text-begin-col="7" text-begin-line="3" text-end-col="28" text-end-line="3">
+                <Input kind="Elements" port="In" text-begin-col="14" text-begin-line="3"
+                       text-end-col="16"
+                       text-end-line="3">
+                    <Decl kind="Input" name="$local$x">
+                        <Type name="int"/>
+                    </Decl>
+                </Input>
+                <Output port="Out" text-begin-col="22" text-begin-line="3" text-end-col="26"
+                        text-end-line="3">
+                    <Expr kind="Let">
+                        <Expr kind="BinOpSeq" text-begin-col="23" text-begin-line="3" text-end-col="25"
+                              text-end-line="3">
+                            <Expr kind="Var" name="$local$x" text-begin-col="23" text-begin-line="3"
+                                  text-end-col="23"
+                                  text-end-line="3"/>
+                            <Op name="-"/>
+                            <Expr kind="Literal" literal-kind="Integer" text-begin-col="25" text-begin-line="3"
+                                  text-end-col="25"
+                                  text-end-line="3"
+                                  value="1"/>
+                        </Expr>
+                    </Expr>
+                </Output>
+            </Action>
+            <Note kind="filepath" value="/home/csandersn/work/actors/example//SubOne.cal"/>
+        </Actor>
+        <Attribute kind="Value" name="clockDomain">
+            <Expr kind="Literal" literal-kind="String" value="CLK"/>
+        </Attribute>
+    </Instance>
+    <Instance id="$id_n$4">
+        <Note kind="UID" value="AddFiveOnce_0"/>
+        <Note kind="instanceHierarchy"/>
+        <Class name="AddFiveOnce"/>
+        <Note kind="sourceLoaded" value="true"/>
+        <Note kind="className" value="AddFiveOnce"/>
+        <Actor name="AddFiveOnce">
+            <Port kind="Input" name="In">
+                <Type name="int"/>
+            </Port>
+            <Port kind="Output" name="Out">
+                <Type name="int"/>
+            </Port>
+            <Action text-begin-col="9" text-begin-line="3" text-end-col="30" text-end-line="3">
+                <QID name="init">
+                    <ID name="init"/>
+                </QID>
+                <Input kind="Elements" port="In" text-begin-col="16" text-begin-line="3"
+                       text-end-col="18"
+                       text-end-line="3">
+                    <Decl kind="Input" name="$local$x">
+                        <Type name="int"/>
+                    </Decl>
+                </Input>
+                <Output port="Out" text-begin-col="24" text-begin-line="3" text-end-col="28"
+                        text-end-line="3">
+                    <Expr kind="Let">
+                        <Expr kind="BinOpSeq" text-begin-col="25" text-begin-line="3" text-end-col="27"
+                              text-end-line="3">
+                            <Expr kind="Var" name="$local$x" text-begin-col="25" text-begin-line="3"
+                                  text-end-col="25"
+                                  text-end-line="3"/>
+                            <Op name="+"/>
+                            <Expr kind="Literal" literal-kind="Integer" text-begin-col="27" text-begin-line="3"
+                                  text-end-col="27"
+                                  text-end-line="3"
+                                  value="5"/>
+                        </Expr>
+                    </Expr>
+                </Output>
+            </Action>
+            <Action text-begin-col="8" text-begin-line="5" text-end-col="27" text-end-line="5">
+                <QID name="run">
+                    <ID name="run"/>
+                </QID>
+                <Input kind="Elements" port="In" text-begin-col="15" text-begin-line="5"
+                       text-end-col="17"
+                       text-end-line="5">
+                    <Decl kind="Input" name="$local$x">
+                        <Type name="int"/>
+                    </Decl>
+                </Input>
+                <Output port="Out" text-begin-col="23" text-begin-line="5" text-end-col="25"
+                        text-end-line="5">
+                    <Expr kind="Let">
+                        <Expr kind="Var" name="$local$x" text-begin-col="24" text-begin-line="5"
+                              text-end-col="24"
+                              text-end-line="5"/>
+                    </Expr>
+                </Output>
+            </Action>
+            <Note kind="filepath" value="/home/csandersn/work/actors/example//AddFiveOnce.cal"/>
+            <Schedule initial-state="init" kind="fsm" text-begin-col="3" text-begin-line="7"
+                      text-end-col="3"
+                      text-end-line="10">
+                <Transition from="init" text-begin-col="4" text-begin-line="8" text-end-col="23"
+                            text-end-line="8"
+                            to="run">
+                    <ActionTags text-begin-col="" text-begin-line="" text-end-col="" text-end-line="">
+                        <QID name="init">
+                            <ID name="init"/>
+                        </QID>
+                    </ActionTags>
+                </Transition>
+                <Transition from="run" text-begin-col="2" text-begin-line="9" text-end-col="19"
+                            text-end-line="9"
+                            to="run">
+                    <ActionTags text-begin-col="" text-begin-line="" text-end-col="" text-end-line="">
+                        <QID name="run">
+                            <ID name="run"/>
+                        </QID>
+                    </ActionTags>
+                </Transition>
+            </Schedule>
+        </Actor>
+        <Attribute kind="Value" name="clockDomain">
+            <Expr kind="Literal" literal-kind="String" value="CLK"/>
+        </Attribute>
+    </Instance>
+    <Instance id="$id_n$5">
+        <Note kind="UID" value="art_Sink_txt_0"/>
+        <Note kind="instanceHierarchy"/>
+        <Class name="art_Sink_txt"/>
+        <Note kind="sourceLoaded" value="true"/>
+        <Note kind="className" value="art_Sink_txt"/>
+        <Actor name="art_Sink_txt">
+            <Import kind="single" text-begin-col="1" text-begin-line="1" text-end-col="27"
+                    text-end-line="1">
+                <QID name="java.io.PrintStream">
+                    <ID name="java"/>
+                    <ID name="io"/>
+                    <ID name="PrintStream"/>
+                </QID>
+            </Import>
+            <Decl kind="Parameter" name="fileName">
+                <Type name="string"/>
+            </Decl>
+            <Port kind="Input" name="In"/>
+            <Decl assignable="Yes" kind="Variable" name="out" text-begin-col=""
+                  text-begin-line=""
+                  text-end-col="39"
+                  text-end-line="7">
+                <Type name="PrintStream"/>
+                <Expr kind="Let">
+                    <Expr kind="Application" text-begin-col="19" text-begin-line="7" text-end-col="39"
+                          text-end-line="7">
+                        <Expr kind="Var" name="PrintStream" text-begin-col="19" text-begin-line="7"
+                              text-end-col="19"
+                              text-end-line="7"/>
+                        <Args>
+                            <Expr kind="Var" name="fileName" text-begin-col="31" text-begin-line="7"
+                                  text-end-col="31"
+                                  text-end-line="7"/>
+                        </Args>
+                    </Expr>
+                </Expr>
+            </Decl>
+            <Action text-begin-col="2" text-begin-line="9" text-end-col="2" text-end-line="12">
+                <Input kind="Elements" port="In" text-begin-col="9" text-begin-line="9"
+                       text-end-col="11"
+                       text-end-line="9">
+                    <Decl kind="Input" name="$local$x"/>
+                </Input>
+                <Stmt kind="Call" text-begin-col="3" text-begin-line="11" text-end-col="28"
+                      text-end-line="11">
+                    <Expr kind="Let">
+                        <Expr kind="Entry" name="println" text-begin-col="3" text-begin-line="11"
+                              text-end-col="7"
+                              text-end-line="11">
+                            <Expr kind="Var" name="out" text-begin-col="3" text-begin-line="11" text-end-col="3"
+                                  text-end-line="11"/>
+                        </Expr>
+                    </Expr>
+                    <Args>
+                        <Expr kind="Let">
+                            <Expr kind="Application" text-begin-col="15" text-begin-line="11" text-end-col="26"
+                                  text-end-line="11">
+                                <Expr kind="Entry" name="toString" text-begin-col="15" text-begin-line="11"
+                                      text-end-col="17"
+                                      text-end-line="11">
+                                    <Expr kind="Var" name="$local$x" text-begin-col="15" text-begin-line="11"
+                                          text-end-col="15"
+                                          text-end-line="11"/>
+                                </Expr>
+                                <Args/>
+                            </Expr>
+                        </Expr>
+                    </Args>
+                </Stmt>
+            </Action>
+            <Note kind="filepath" value="/home/csandersn/work/actors/example//art_Sink_txt.cal"/>
+        </Actor>
+        <Attribute kind="Value" name="clockDomain">
+            <Expr kind="Literal" literal-kind="String" value="CLK"/>
+        </Attribute>
+    </Instance>
+    <Connection dst="$id_n$1" dst-port="In" src="$id_n$0" src-port="Out"/>
+    <Connection dst="$id_n$2" dst-port="In" src="$id_n$1" src-port="Out"/>
+    <Connection dst="$id_n$3" dst-port="In" src="$id_n$2" src-port="Out"/>
+    <Connection dst="$id_n$4" dst-port="In" src="$id_n$3" src-port="Out"/>
+    <Connection dst="$id_n$5" dst-port="In" src="$id_n$4" src-port="Out"/>
+    <Note kind="Directive" name="default-type-name">
+        <Expr kind="Literal" literal-kind="String" value="int"/>
+    </Note>
+    <Note kind="Directive" name="default-type-templates">
+        <Type name="int">
+            <Entry kind="Expr" name="size">
+                <Expr kind="Literal" literal-kind="Integer" value="32"/>
+            </Entry>
+        </Type>
+    </Note>
+</XDF>
\ No newline at end of file
diff --git a/examples/xdf/xdf.xsd b/examples/xdf/xdf.xsd
new file mode 100644
index 0000000000000000000000000000000000000000..7375f3af19744ce8b2da6ad6126953ec5d3c3edb
--- /dev/null
+++ b/examples/xdf/xdf.xsd
@@ -0,0 +1,277 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+  <xs:element name="XDF">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Instance"/>
+        <xs:element maxOccurs="unbounded" ref="Connection"/>
+        <xs:element maxOccurs="unbounded" ref="Note"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Instance">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="Note"/>
+          <xs:element ref="Class"/>
+          <xs:element ref="Parameter"/>
+        </xs:choice>
+        <xs:element ref="Actor"/>
+        <xs:element ref="Attribute"/>
+      </xs:sequence>
+      <xs:attribute name="id" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Class">
+    <xs:complexType>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Parameter">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Actor">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Import"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="Decl"/>
+          <xs:element ref="Port"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="Action"/>
+        <xs:element ref="Note"/>
+        <xs:element minOccurs="0" ref="Schedule"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Import">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="QID"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Port">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Type"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Action">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="QID"/>
+        <xs:element minOccurs="0" ref="Input"/>
+        <xs:element minOccurs="0" ref="Output"/>
+        <xs:choice minOccurs="0">
+          <xs:element ref="Guards"/>
+          <xs:element ref="Stmt"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Input">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Decl"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="port" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Output">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="port" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Guards">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Stmt">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+        <xs:element ref="Args"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Schedule">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Transition"/>
+      </xs:sequence>
+      <xs:attribute name="initial-state" use="required" type="xs:NCName"/>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Transition">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ActionTags"/>
+      </xs:sequence>
+      <xs:attribute name="from" use="required" type="xs:NCName"/>
+      <xs:attribute name="text-begin-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-col" use="required" type="xs:integer"/>
+      <xs:attribute name="text-end-line" use="required" type="xs:integer"/>
+      <xs:attribute name="to" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ActionTags">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="QID"/>
+      </xs:sequence>
+      <xs:attribute name="text-begin-col" use="required"/>
+      <xs:attribute name="text-begin-line" use="required"/>
+      <xs:attribute name="text-end-col" use="required"/>
+      <xs:attribute name="text-end-line" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Attribute">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Connection">
+    <xs:complexType>
+      <xs:attribute name="dst" use="required"/>
+      <xs:attribute name="dst-port" use="required" type="xs:NCName"/>
+      <xs:attribute name="src" use="required"/>
+      <xs:attribute name="src-port" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Note">
+    <xs:complexType>
+      <xs:choice minOccurs="0">
+        <xs:element ref="Expr"/>
+        <xs:element ref="Type"/>
+      </xs:choice>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" type="xs:NCName"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Expr">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Args"/>
+        <xs:element minOccurs="0" ref="Op"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="literal-kind" type="xs:NCName"/>
+      <xs:attribute name="name"/>
+      <xs:attribute name="text-begin-col" type="xs:integer"/>
+      <xs:attribute name="text-begin-line" type="xs:integer"/>
+      <xs:attribute name="text-end-col" type="xs:integer"/>
+      <xs:attribute name="text-end-line" type="xs:integer"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Op">
+    <xs:complexType>
+      <xs:attribute name="name" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="QID">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="ID"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ID">
+    <xs:complexType>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Decl">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Type"/>
+        <xs:element minOccurs="0" ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="assignable" type="xs:NCName"/>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="text-begin-col"/>
+      <xs:attribute name="text-begin-line"/>
+      <xs:attribute name="text-end-col" type="xs:integer"/>
+      <xs:attribute name="text-end-line" type="xs:integer"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Type">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Entry"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Entry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="Expr"/>
+      </xs:sequence>
+      <xs:attribute name="kind" use="required" type="xs:NCName"/>
+      <xs:attribute name="name" use="required" type="xs:NCName"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Args">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="Expr"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>