module XML { enum attribute_kind { CDATA, IDref, ID, IDrefs }; enum element_kind { TAG, PCDATA }; union attribute_type switch (attribute_kind) { case CDATA: string value; case IDref: string id_ref; case IDrefs: list id_refs; case ID: string xid; }; struct attribute_binding { string name; attribute_type value; }; struct node_type { string name; list attributes; list content; }; union element_type switch (element_kind) { case TAG: node_type tag; case PCDATA: string data; }; class XML_element ( extent Elements ) { attribute element_type xml_element; string data(); string tag(); }; class XML_document ( extent Documents key name ) { attribute string name; attribute list content; }; };