Listing 1 AuthoredEnums.xml
<Enumerations>
<EnumDef name = 'AccessEnum'>
<choices>
<choice name = 'read_only' value = '1'/>
<choice name = 'read_write' value = '2'/>
</choices>
</EnumDef>
<EnumDef name = 'SeverityEnum'>
<choices>
<choice name = 'critical' value = '1'/>
<choice name = 'major' value = '2'/>
<choice name = 'minor' value = '3'/>
<choice name = 'warning' value = '4'/>
</choices>
</EnumDef>
</Enumerations>

Listing 2 GeneratedEnums.xml
<Enumerations>
<EnumDef name = "ActionEnum">
<choices>
<choice name = "start" value = "1"/>
<choice name = "stop" value = "2"/>
<choice name = "test" value = "3"/>
</choices>
</EnumDef>
<EnumDef name = "AccessControlEnum">
<choices>
<choice name = "permit" value = "1"/>
<choice name = "deny" value = "2"/>
</choices>
</EnumDef>
</Enumerations>

Listing 3 AllEnums.xml
<?xml version = "1.0"?>
<!DOCTYPE AllEnums[
<!ENTITY include_authored_enums SYSTEM "AuthoredEnums.xml">
<!ENTITY include_generated_enums SYSTEM "GeneratedEnums.xml">
]>
<AllEnums>
&include_authored_enums;
&include_generated_enums;
</AllEnums>

Listing 4 Enum_codegen.xslt(version 1)
<?xml version='1.0'?>
<xsl:stylesheet version='1.0'
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<xsl:output omit-xml-declaration='yes'/>

<xsl:template match = '/'>
<xsl:for-each select='//EnumDef''>
//@@@BEGIN_FILE <xsl:value-of select='@name'/>.java
//@@@LOCATION common.gencode.enums
//*************************************
//*********** Generated code. ************
//*************************************
public class <xsl:value-of select='@name'/>
{
public static String getEnumValueAsString
(int enumValue)
{
}
}
//@@@END_FILE AccessEnum.java
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Listing 5 gen_enum.snp
//@@BEGIN_FILE ActionEnum.java
//@@@LOCATION common.gencode.enums
//************************************
//********* Generated Code ***********
//************************************
public class ActionEnum
(
public static string getEnumValueAsString
(int enumValue
(
)

)
//@@END_FILE ActionEnum.java
... ... .
Repetition of above pattern for SeverityEnum.java,
AccessEnum.java, AccessControlEnum.java
... ... . 

Listing 6 XSLT code fragment
Public static String getEnumValueAsString(int enumValue)
{
switch(enumValue)
{<xsl:for-each select='choices/choice'>
case <xsl:value-of select='@value'/>:
return "<xsl:value-of select='@name'/>;
</xsl:for-each>

default:
return null;
}
}

Listing 7 Corresponding generated code fragment
7 public static String getEnumValueAsString(int enumValue)
{
switch(enumValue)
{
case 1:
return "start";
case 2:
return "stop";
case 3:
return "test";

default:
return null;
}
}

Listing 8 Example of object and relational modeling in XML
<managed-object class-name = "Employee">
<base-object class-name = "Person"/>
<containing-object class-name = "Division"/>
< one-to-many-relation role-name = "my-subordinates" class-name = "Employee"/> 
<one-to-one-relation role-name = "my-boss" class-name = "Employee"/>
<attribute name = "salary" type = "float"/>
<attribute name = "job-title" type = "string"/>
<attribute name = "join-date" type = "java.util.Date"/>