diff --git a/LICENSE b/LICENSE
index a8dd16f41736c7d9c3934cb9ce5b6c823592fcfa..92666deff26cda52d05622288597d1dbd00e42a8 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,191 +1,11 @@
-Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
+Copyright 2018, oneM2M Partners Type 1
 
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
 
-   1. Definitions.
+1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
 
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
+2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
 
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   Copyright 2014 HGI Home Gateway Initiative
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
+3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
 
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/README.md b/README.md
index aab8c1a6f0fbda291bf27b3cbf67e80e3df57811..09942bb4b809515b895ba000bc5f7b991aff45e0 100644
--- a/README.md
+++ b/README.md
@@ -2,9 +2,9 @@
 
 Repository for the Smart Device Template (SDT).
 
-**Version 3.0**
+**Version 4.0**
 
-Note that this project runs under Apache 2.0 license. Read the [LICENSE](LICENSE) in this repository, or refer to [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)
+Note that this project runs under the 3-Clause BSD License. Read the [LICENSE](LICENSE) in this repository, or refer to  [https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause).
 
 Any contributions made to this project must comply with the aforementioned license.
 
@@ -12,23 +12,23 @@ Any contributions made to this project must comply with the aforementioned licen
 
 The Smart Device Template (SDT) is a template which is used to model the capabilities, actions and events of connected devices. The intent of the SDT is to be able to model any type of connected device using a well accepted and standardised format. The main application of SDT is to enable a uniformly structured Application Programmer’s Interface (API) to applications that need to interact with connected devices. Usually, these applications would communicate to devices using an Abstraction Layer as an intermediary logic. The Abstraction Layer „hides“ the technology-specific, native language format of devices of different technology type from the applications.
 
-[Read the full Introduction.](SDT/schema3.0/docs/Introduction.md)
+[Read the full Introduction.](SDT/schema4.0/docs/Introduction.md)
 
 ## Quick Links
-- ['domain.xsd' Version 3.0](SDT/schema3.0/src/domain.xsd)
-- [UML Diagram of the SDT 3.0](SDT/schema3.0/docs/UML%20Diagram.md) ([source](SDT/schema3.0/docs/SDT_UML.uxf))
+- ['domain.xsd' Version 4.0](SDT/schema4.0/src/domain.xsd)
+- [UML Diagram of the SDT 4.0](SDT/schema4.0/docs/UML%20Diagram.md) ([source](SDT/schema4.0/docs/SDT_UML.uxf))
 
 
 ## Content
 
 You can find further Information here:
 
-- [Introduction to the SDT](SDT/schema3.0/docs/Introduction.md)
-- [SDT Components](SDT/schema3.0/docs/SDT_Components.md)
-- [SDT Build System](SDT/schema3.0/docs/SDT%20Build%20System.md)
-- [Examples](SDT/schema3.0/docs/Examples.md) 
-- [Links & References](SDT/schema3.0/docs/Links.md)
-- [Changelog](SDT/schema3.0/docs/Changelog.md)
+- [Introduction to the SDT](SDT/schema4.0/docs/Introduction.md)
+- [SDT Components](SDT/schema4.0/docs/SDT_Components.md)
+- [SDT Build System](SDT/schema4.0/docs/SDT%20Build%20System.md)
+- [Examples](SDT/schema4.0/docs/Examples.md) 
+- [Links & References](SDT/schema4.0/docs/Links.md)
+- [Changelog](SDT/schema4.0/docs/Changelog.md)
 - [LICENSE](LICENSE)
 
 
diff --git a/SDT/schema4.0/build.xml b/SDT/schema4.0/build.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ca74f2f8baa22447c6c75c30b903c786887572d0
--- /dev/null
+++ b/SDT/schema4.0/build.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!-- - HGI Device Abstraction Layer  - - - - - - - - - - - - - - - - - - - - -->
+<!--                                                                         -->
+<!--   Extends the standard build with targets for: 			     -->
+<!--    - generate XML schema the from Relax NG (xml) description	     -->
+<!--    - validate DAL documents against the XML Schema			     -->
+<!--    - generate HTML documentation from DAL documents 		     -->
+
+<project name="importing" basedir="." default="schemas">
+  <import file="etc/common.xml"/>
+
+  <!-- Read the namespace declarations from a file (to get linebreaks) - - - -->
+
+  <loadfile property="schema.xmlns" srcFile="${basedir}/etc/schema.xmlns"/>
+
+  <!-- The RNG file the XML and RNC schemas are generaed from  - - - - - - - -->
+
+  <property name="schema.name" value="domain"/>
+  <property name="schema.rng" value="${path.src}/${schema.name}.rng"/>
+
+  <!-- HTML  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                       -->
+  <!-- Generate HTML documentation from domain definitions in the test       -->
+  <!-- directory. The module classes included via the extends tagged are     -->
+  <!-- included in the documentation - so an xinclude capable XSL engine is  -->
+  <!-- needed.                                                               -->
+  <!-- This needs Ant version 1.8+ and it must be augmented with an current  -->
+  <!-- version of Xerces. Download the binray distribution and place the put -->
+  <!-- xml-apis.jar and xercesImpl.jar in the Ant lib directory.             -->
+
+  <target name="html">
+	<mkdir dir="${path.genbase}" />
+    <xslt basedir="${basedir}/test" destdir="${basedir}/gen/html"
+	  style="${basedir}/style/html.xsl">
+      <param name="destdir" expression="${basedir}/gen/html"/>
+      <sysproperty
+	  key="org.apache.xerces.xni.parser.XMLParserConfiguration"
+	  value="org.apache.xerces.parsers.XIncludeParserConfiguration"/>
+    </xslt>
+  </target>
+
+  <!-- Schemas - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                       -->
+  <!-- The schema is specified using Relax NG (xml) and trang is used to     -->
+  <!-- generate the XML schema. The schema is also generated in Relay NG     -->
+  <!-- compact syntax, which is used by some validating editors (e.g. emacs) -->
+  <!-- The resulting schemas need some additional patching before thy are    -->
+  <!-- usable                                                                -->
+
+  <target name="schemas">
+    <java jar="${basedir}/lib/trang.jar" fork="true">
+      <arg value="${schema.rng}"/>
+      <arg value="${basedir}/etc/${schema.name}.rnc"/>
+    </java>
+
+    <!-- So that the editor does not complain about include directives, the -->
+    <!-- resulting schema is included in another schema, which includes the -->
+    <!-- necessary element definitions. To be able to do this the           -->
+    <!-- definition for Imports must be deleted from this generated schema. -->
+
+    <replace file="${basedir}/etc/${schema.name}.rnc"
+	     token="Imports = element Imports { Domain* }?" value=""/>
+
+    <java jar="${basedir}/lib/trang.jar" fork="true">
+      <arg value="${schema.rng}"/>
+      <arg value="${path.src}/${schema.name}.xsd"/>
+    </java>
+
+    <!-- Can't validate against the generated schema unless we add the      -->
+    <!-- target and default namespaces ...                                  -->
+
+    <replace file='${path.src}/domain.xsd'
+	     token='xmlns:xs="http://www.w3.org/2001/XMLSchema"'
+	     value='${schema.xmlns}'/>
+
+    <!-- In addition the xml:base tag, which is added automatically when    -->
+    <!-- including a document, must also be permitted by out schema.        -->
+    <!-- The schema generated from RNG is almost correct schema ... but     -->
+    <!-- the schemaLocation is wrong.                                       -->
+
+    <replace file='${path.src}/domain.xsd'
+	     token="xml.xsd" value="http://www.w3.org/2001/03/xml.xsd"/>
+  </target>
+
+  <!-- Validate  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                       -->
+  <!-- Check the Device Description conforms to the Device Abstraction       -->
+  <!-- Schema. Note that we need to activate support for XML includes        -->
+
+  <target name="validate" depends="">
+    <schemavalidate warn="true">
+      <fileset dir="${basedir}/test" includes="*.xml"/>
+      <attribute name="http://apache.org/xml/features/xinclude" value="true"/>
+      <schema namespace="http://homegatewayinitiative.org/xml/dal/3.0"
+	      file="${path.src}/domain.xsd" />
+      <schema namespace="http://www.w3.org/2001/XInclude"
+	      file="${basedir}/etc/XInclude.xsd" />
+      <schema namespace="http://www.w3.org/2001/XMLSchema"
+	      file="${basedir}/etc/XMLSchema.xsd" />
+    </schemavalidate>
+  </target>
+
+</project>
+
diff --git a/SDT/schema4.0/docs/Changelog.md b/SDT/schema4.0/docs/Changelog.md
new file mode 100644
index 0000000000000000000000000000000000000000..e655c642863a551c0951853cb017ebc04132bf6b
--- /dev/null
+++ b/SDT/schema4.0/docs/Changelog.md
@@ -0,0 +1,36 @@
+# Changelog
+
+## Changes in 4.0
+
+
+## Changes in 3.0
+- Renamed ``<RootDevice>``to ``<Device>`` and ``<Device>`` to ``<SubDevice>``,
+- Added complex data types: *Struct* and *Arrays*.
+- Simplified the UML diagram. Split the UML diagram into two parts, one for the base elements and one for the data types.
+- In the UML diagram: Moved ``<extends>`` into the UML ``<ModuleClass>`` element (easier to read).
+- Added support to specify *Units of Measurement* to data types,
+- Added ``<Doc>`` to ``<Domain>`` and other elements.
+- ``<Doc>`` is now always the first part of an element.
+- Changed ``<DeviceInfo>`` element to a list of ``<Characteristic>``.
+- Added ``<Characteristic>`` list to ``<Modules>`` and ``<ModuleClasses>``.
+- The ``<data>`` element in ``<Event>`` is now optional to support events without attached or associated data.
+- In Actions: Added ``<Args>`` as a surrounding list around a list of ``<Arg>``.
+- Added *Constraints* to ``<DataType>``.
+- Added optional *name* attribute to ``<DataType>``. This mandatory for elements of a *struct*.
+- Restructured the [RNG](SDT/schema3.0/src/domain.rng) file for better readability and maintainability.
+- In the [RNG](SDT/schema3.0/src/domain.rng)/[XSD](SDT/schema3.0/src/domain.xsd): Changed cardinality of the occurrence of elements that are part of a list of elements (e.g. ``<SubDevices><SubDevice>…</SubDevice></SubDevices>`` from „zero or more“ to „one or more“ when the surrounding list element itself is optional (to avoid empty lists).
+
+
+
+## Changes in 2.0.1
+- Added missing "uri" data type.
+
+## Changes in 2.0
+- Introduced RootDevice to support hierarchical embedded devices.
+- Added new data types (byte, float, array, enum, date, time, datetime, blob, uri)
+- Added ``readable`` and ``eventable`` to data points.
+- Added optional ``<SerialNumber>``, ``<VendorURL>`` and ``<FirmwareVersion>`` elements to DeviceInfo
+- Added optional ``<Doc>`` element to Event
+- Changed the optionality of the ``<DataPoint>``'s ``type`` attribute to "required".
+- Added [UML diagram](SDT/schema2.0/docs/SDT_Components.md)
+- Changed the namespace for the XSD from "hgi.org" to "homegatewayinitiative.org".
\ No newline at end of file
diff --git a/SDT/schema4.0/docs/Examples.md b/SDT/schema4.0/docs/Examples.md
new file mode 100644
index 0000000000000000000000000000000000000000..5cdf3f82eee2879fc45c93928c0b25c1e11e1218
--- /dev/null
+++ b/SDT/schema4.0/docs/Examples.md
@@ -0,0 +1,159 @@
+# Examples and Contributions
+[A simple example](#simpleExample)  
+[Multi Socket Electrical-Extension-Block](#mseeb)
+
+<a name="simpleExample"></a>
+## A very simple SDT example
+In the ideal case, a large organization or SDO would define a widely-applicable set of [ModuleClasses](SDT_Components.md#ModuleClass), each of which could be used as needed to compose the description of a complex device. In order to show the appoach, this section will create a few example ModuleClasses based on - or inspired by - featues in the Echonet Lite protocol. Please note that the examples shown in this document are very "cut down" and by no means represent a true representation of Echonet Lite.
+
+The Echonet Consortium has standardized their specifications within IEC/ISO (IEC62394, ISO/IEC24767-1, ISO/IEC24767-2, IEC62480, ISO/IEC14543-4-1, ISO/IEC14543-4-2, IEC62457) and they provide a comprehensive collection of various types of home appliances relevant to SmartGrid applications as ECHONET Device objects (see [https://echonet.jp/spec_object_rf_en/](https://echonet.jp/spec_object_rf_en/) ).
+
+For the example in this document, to show re-use of ModuleClass definitions, two complex devices are chosen which have some common features and hence could be expected to both use some of the same ModuleClasses: an air conditioner and a washing machine.
+
+<table>
+<tr><th>Funtionality</th><th>Air Conditioner</th><th>Washing Machine</th></tr>
+<tr><td>operationStatus</td><td>operates on/off</td><td>operates on/off</td></tr>
+<tr><td>measuredCumulativePowerConsumption</td><td>the cumulative power consumption</td><td>the cumulative power consumption</td></tr>
+<tr><td>installationLocation</td><td>this sets/reads a string text describing the location (room) of the air-conditioner.</td><td>this sets/reads a string text describing the location (room) of the washing machine.</td></tr>
+<tr><td>setTimer</td><td>(not applicable. there is no preset start for an air-conditioner)</td><td>This sets/reads use the on/off timer</td></tr>
+</table>
+
+Based on the simplified example above, the two appliances will need the ModuleClasses below:
+
+- *air-conditioner*: operationStatus, measuredCumulativePowerConsumption, installationLocation;
+- *washing-machine*: operationStatus, measuredCumulativePowerConsumption, and setTimer. 
+
+		<ModuleClass name="operationStatus">
+			<Data>
+				<DataPoint name="operationStatus" writable="true">
+					<Doc>This property sets/reads the ON/OFF status.</Doc>
+						<DataType>
+							<SimpleType type="boolean"/> 
+						</DataType>
+				</DataPoint>
+			</Data>
+			<Events>
+				<Event name="operationStatus">
+				</Event>
+			</Events>
+		</ModuleClass>
+
+		<ModuleClass name="measuredCumulativePowerConsumption">
+			<Data>
+				<DataPoint name="measuredCumulativePowerConsumption" writable="false">
+					<Doc>This indicates cumulative power consumption of the device in increments of 0.001kWh.</Doc>
+					<DataType>
+						<SimpleType type="integer"/>
+					</DataType>
+				</DataPoint>
+			</Data>
+		</ModuleClass>
+
+		<ModuleClass name="installationLocation">
+			<Data>
+				<DataPoint name="installationLocation" writable="true">
+					<Doc>This property indicates the installation location</Doc>
+					<DataType>
+						<SimpleType type="string"/>
+					</DataType>
+				</DataPoint>
+			</Data>
+			<Events>
+				<Event name="installationLocation"> </Event>
+			</Events>
+		</ModuleClass>
+
+		<ModuleClass name="onTimerSetting">
+			<DataPoint name="onTimer" writable="true">
+				<Doc>Timer value (HH:MM)</Doc>
+				<DataType>
+					<SimpleType type="time"/>
+				</DataType>
+			</DataPoint>
+		</ModuleClass>
+
+The structure and the according SDT now looks like this:
+
+<table>
+<tr><td colspan="2" width="50%"><b>Example1.SDT</b></td></tr>
+<tr><td> </td><td>Namespace information</td></tr>
+<tr><td> </td><td>Modules (contains ModuleClasses)</td></tr>
+<tr><td> </td><td>operationStatus<ul>
+	<li>measuredCumulativePowerConsumption</li>
+	<li>installationLocation</li>
+	<li>onTimerSetting</li></ul></td></tr>
+</table>
+
+		<?xml version="1.0" encoding="iso-8859-1"?>
+		<!-- Example1 SDT inspired by some Echonet Lite examples -->
+		<Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
+			xmlns:xi="http://www.w3.org/2001/XInclude"
+			id="example1.SDT">
+		
+		<Modules>
+		<!-- Various examples for module classes -->
+		<ModuleClass name="operationStatus">
+			<Data>
+				<DataPoint name="operationStatus" writable="true">
+					<Doc>This property sets the ON/OFF status.</Doc>
+						<DataType>
+							<SimpleType type="boolean"/> 
+						</DataType>
+				</DataPoint>
+			</Data>
+			<Events>
+				<Event name="operationStatus">
+				</Event>
+			</Events>
+		</ModuleClass>
+
+		<ModuleClass name="installationLocation">
+			<Data>
+				<DataPoint name="installationLocation" writable="true">
+					<Doc>This property indicates the installation location</Doc>
+					<DataType>
+						<SimpleType type="string"/>
+					</DataType>
+				</DataPoint>
+			</Data>
+			<Events>
+				<Event name="installationLocation"> </Event>
+			</Events>
+		</ModuleClass>
+
+		<ModuleClass name="measuredCumulativePowerConsumption">
+			<Data>
+				<DataPoint name="measuredCumulativePowerConsumption" writable="false">
+					<Doc>This indicates cumulative power consumption of the device in increments of 0.001kWh.</Doc>
+					<DataType>
+						<SimpleType type="integer"/>
+					</DataType>
+				</DataPoint>
+			</Data>
+		</ModuleClass>
+
+		<ModuleClass name="onTimerSetting">
+			<DataPoint name="onTimer" writable="true">
+				<Doc>Timer value (HH:MM)</Doc>
+				<DataType>
+					<SimpleType type="time"/>
+				</DataType>
+			</DataPoint>
+		</ModuleClass>
+			</Modules>
+		</Domain>
+
+
+---
+
+<a name="mseeb"></a>
+### Multi Socket Electrical-Extension-Block
+
+This example is a specification for an imaginged device, a connected extension block with multiple power socket where each of the sockets are modeled as a 
+separate *SubDevice*.
+
+[mseeb.xml](../test/mseeb.xml)
+
+
+---
+
diff --git a/SDT/schema4.0/docs/FAQ.md b/SDT/schema4.0/docs/FAQ.md
new file mode 100644
index 0000000000000000000000000000000000000000..77c4fb4e2c1fbda17077241d0a41365c4be7888d
--- /dev/null
+++ b/SDT/schema4.0/docs/FAQ.md
@@ -0,0 +1,7 @@
+# Frequently Asked Questions
+
+## What is the HGI?
+tbd
+
+## What is the SDT?
+tbd
diff --git a/SDT/schema4.0/docs/Introduction.md b/SDT/schema4.0/docs/Introduction.md
new file mode 100644
index 0000000000000000000000000000000000000000..08ad356e43eb82a7356e39e7bed122420ba085d9
--- /dev/null
+++ b/SDT/schema4.0/docs/Introduction.md
@@ -0,0 +1,89 @@
+# Introduction to the SDT
+
+The SDT (Smart Device Template) is an initiative from HGI to find consensus amongst various SDOs and industry alliances to derive a common approach for device modelling. HGI and partners have the approach to agree on a set of automation commands, following a common syntax, which are sufficient to model most home appliance functions.
+
+At the time of writing, every software developed for home gateways or internet-of-things gateways needs to be capable of using various different protocols (ZigBee, UPnP, EchonetLite, DECT ULE, etc) to interact with a range of devices designed for the home environment. This adds extreme overheads in integrating, checking and updating code. The purpose of SDT is to describe devices and device services in a way which is independent of the LAN technology, in a format which is convenient and reliable for integration in modern code (Java, C/C++, ...).
+
+The key goals of the SDT are: (1) keep it simple, especially for manufacturers to contribute device information; (2) modularity for functions and device types; (3) make it easy for developers to create unified APIs; (4) be independent of underlying home-area network technologies; (4) enable extendibility of the system in place without service interruption; (5) allow a pass-through mechanism to enable use of proprietary or technology-specific functions.
+
+In general a description of device (or complex appliance) behaviour can be made in many ways, with various kinds of constraints:
+
+1. no constraints (e.g. using OWL 2.0 or even more "flexibly" RDF)
+2. moderate constraints (e.g. using XML and a related extensible XSD template)
+3. strict constraints (typical for a device certified to interoperate with a specific LAN protocol)
+
+HGI chose to use the approach "moderate constraints" (XSD based) because for software development it offers ease of use and a good compromise. In particular, if there are few or no constraints on control parameters then few automatic checks can be made to detect if the software parameters are appropriate for each device integrated. XML and XSD languages were chosen because they are familiar to many developers, can be parsed with common software tools, and can still be created and interpreted by humans if necessary.
+
+HGI believes that Device information models based on XML and extensible XSD need some guidelines. If every possible feature of every existing LAN technology and appliance were allowed to be described in any formally correct way, then the results would be a modern Babel, no better than today's system of widely different and wildly competing automation protocols. 
+
+Therefore HGI proposes to recommend a certain structure (template) for the information model(s), but to allow extensions. Naturally, the more industry consensus is achieved for a single recommended template, the greater the utility for software developers (and users).
+
+The  SDT approach is to define re-usable basic functions (or services), labelled "ModuleClass" in the figure below, which can represent the typical functions found in many home automation systems, such as "on/off", "dim a lamp", "receive events from binary sensor", "read data from sensor", etc. Each ModuleClass is composed of a (small) number of actions, datapoint read/write operations, or asynchronous events. For example, an "on/off" ModuleClass would consist perhaps of just one Action, but a "ReadKeypad" Action might have a number of possible events, each with some data value and (usually) a sequence-ID or timestamp start/stop to indicate when and how long each key was pressed.
+ 
+
+![SmartHome Device Template (XSD) for a generic device (simplification)](images/SDT_simplified.png)  
+**SmartHome Device Template (XSD) for a generic device (simplification)**
+
+The  SDT represents the device models introduced in the above figure by using an XSD schema to allow formal checking of compliance for XML device descriptions of specific appliances. The modularity  goal  in the XSD schema is achieved with  re-usable XSD fragments ("ModuleClass" in the figure). 
+
+Complex devices or appliances can then be described by an appropriate set or collection of the agreed XSD fragments (ModuleClasses), as indicated in the figure, which also shows an optional DeviceInfo XSD fragment to allow noting of static information such as device manufacturer name, device firmware version, etc etc.
+
+HGI has discussed with many SDOs to validate these concepts. SDT is designed to take into account the list of "services" compiled by the SAREF project (https://sites.google.com/site/smartappliancesproject/home).
+
+The SDT supports the use of a set of templates for generic devices or appliances (e.g. for a dimmable lamp, a basic washing machine, etc, which would be specific instances of the "Device" object , which form the basis of APIs used by application developers. These templates can also be referenced by manufacturers creating XML documents to describe their specific products. For example, the SDT enables specification of a generic washing machine template, with on/off, set-wash-temperature, pause and a few other commands, which could be referenced by a manufacturer as the schema for a XML description of a basic model washing machine. The SDT allows for vendor-specific additional commands (ModuleClasses) to suit specific product types. 
+
+The interoperability benefits can potentially partially be obtained even without a fully complete interoperability of the SDT. For example, the most common functions can be modeled with SDT, and more particular functions can be modeled with technology-specific, proprietary, or seldom-used aspects. 
+
+Various details about the recommended structure for SDTs are described in the next sections. The key point to keep in mind is that HGI sought a compromise between, at the one extreme, complete flexibility (which could describe any device, of any complexity) and, at the other extreme, a rigid structure which could be 100% validated and lead to validated software APIs.
+
+
+## Definitions
+
+This section provides an overview about the SDT 4.0 definitions and element hierarchy. Terms to be described in detail in this section are:
+
+| Term |  Definition  |
+|------|------------|
+|Domain | Unique name, or "wrapper" which acts like a namespace, set by the organization creating the SDT, allowing reference to a package of definitions for the contained ModuleClasses and device definitions. Can be referenced when extending ModuleClasses. It has two possible uses: to select the scope of a technology domain, or to set the scope of a use case domain (like Home, SmartGrid, etc) |
+| Device | Physical, addressable, identifiable appliance/sensor/actuator. |
+| Sub-Device | A device (usually one of several) which may be embedded in a Device and/or is addressed via another Device. |
+| ModuleClass | Specification of a single service with one or more service methods, the involved abstracted data model and related events. The expectation is that each separate service which may be used in many kinds of Devices (like PowerON/OFF, Open/Close, ...) will be described by a ModuleClass which can be re-used in many Device definitions. |
+| Module | Instantiation of a ModuleClass for a specific Device or SubDevice|
+
+**Definitions of SDT Elements.**
+
+A major decision, facilitating validation of code and signalling, was to describe services (functionality) of devices in terms of ModuleClasses made up of combinations of three kinds of elements:
+
+1. DataPoints which are aspects of the Device that can be read/written,
+2. Actions which consist of more complex sequences of operations;
+3. Events which can be signalled ("published") by devices asynchronously. 
+
+This ModuleClass structure is shown in the figure below and is a major part of the SDT which is illustrated in detail in the following figure:
+ 
+![UML description of device functionality in terms of Actions, DataPoints and Events](images/MC.Action.DataPoint.Event.png)  
+**UML description of device functionality in terms of Actions, DataPoints and Events**
+
+## How should SDT work?
+
+The basic concept is that a manufacturer, organisation or global SDO would define its preferred Smart Device Template, in XML, specified by and based on an XSD. Using that XSD, manufacturers or indeed hobbyists could "describe" existing or new devices by means of XML files, specifying the capabilities and the parameters needed to control the devices.
+
+Assuming that the XML files conform to the specified XSD and to some guidelines described in this document, software developers could readily create APIs able to "parse" the XML-descriptions of devices and (assuming the underlying LAN technology of the device is supported by the software/hardware environment in the gateway) operate the equipment.
+
+The key to making software reliably interoperate with various technologies is to define in the SDT a finite and convenient to use number of functions (which is the decision of the SDO which are commonly used and can therefore be reliably re-used in software for one type of device or another.
+
+For the convenience of users and developers, it would also be possible to collect the device descriptions of common "modules" (types of) appliances so that the operations of "a generic air-conditioner" could be agreed and re-used often, adapting descriptions of special models with just some special features added as local extensions. Agreeing on the definition of "a generic XYZ appliance" is rather time-consuming, so such "repository" may not become standardised, however the basic approach has huge benefits even if such an archive (also known as a "hierarchical ontology") is never formally agreed.
+
+## Related aspects which are out of scope of the SDT
+
+The SDT defines the structure of all compliant XML descriptions. Each XML description of a specific device is definable at the time of manufacture of the device and can therefore only contain "static" information: (a) manufacturer data in the form of documentation elements and properties, (b) device capability information detailing the firmware operations and types/meanings of input/output variables. 
+
+NOT directly part of this work is a related but separate aspect of every gateway software development: a "device abstraction layer" which can translate between (1) software APIs written based on a particular SDT and (2) the "commands" expected by several different LAN protocols and their hardware controllers. 
+
+Programmers developing a "device abstraction layer" for software in a gateway need to create run-time representations of all the recognized devices, their operations and their actual states. This internal "information model" needs to be updated in real time as the devices and the users interact. Programmers may be tempted to use the SDT structure to organize their real-time information model, adding additional information elements for the current state of each device, for some kind of "history" of commands sent/acknowledged, the user etc. 
+
+The above is an efficient approach BUT it must be clear that the real-time state information and history of events, etc, can NOT be represented in a pre-defined SDT and in the XML giving specific details for a device.
+
+---
+
+Click [here](SDT_Components.md) for detailed documentation about SDT.
+
+
diff --git a/SDT/schema4.0/docs/Links.md b/SDT/schema4.0/docs/Links.md
new file mode 100644
index 0000000000000000000000000000000000000000..3116385617704f49a4ba246ab9934f2131aadc3c
--- /dev/null
+++ b/SDT/schema4.0/docs/Links.md
@@ -0,0 +1,14 @@
+# Links & References
+- **HGI** : [http://www.homegatewayinitiative.org](http://www.homegatewayinitiative.org)
+
+## XML
+- **RELAX NG** : [http://relaxng.org](http://relaxng.org)
+	- **RELAX NG Tutorial** : [http://relaxng.org/tutorial-20011203.html](http://relaxng.org/tutorial-20011203.html)
+
+## Tools
+- **UMLet**	: [http://www.umlet.com](http://www.umlet.com)  
+The free UML drawing tool used to draw the UML file.
+- **Apache Ant** : [http://ant.apache.org](http://ant.apache.org)  
+Build tool
+
+
diff --git a/SDT/schema4.0/docs/SDT Build System Components and Licenses.md b/SDT/schema4.0/docs/SDT Build System Components and Licenses.md
new file mode 100644
index 0000000000000000000000000000000000000000..962b1271297453113611581380691ac86c1758a2
--- /dev/null
+++ b/SDT/schema4.0/docs/SDT Build System Components and Licenses.md	
@@ -0,0 +1,65 @@
+# Build System Libraries and Licenses
+The following libraries are used in the build system for the SDT.
+
+## trang.jar
+
+[http://www.thaiopensource.com/relaxng/trang-manual.html](http://www.thaiopensource.com/relaxng/trang-manual.html)
+
+*Trang* takes as input a schema written in any of the following formats:
+
+- RELAX NG (XML syntax)
+- RELAX NG (compact syntax)
+- XML 1.0 DTD
+
+and produces as output a schema written in any of the following formats:
+
+- RELAX NG (XML syntax)
+- RELAX NG (compact syntax)
+- XML 1.0 DTD
+- W3C XML Schema
+
+*Trang* can also infer a schema from one or more example XML documents.
+
+
+### License
+Copyright (c) 2002, 2003, 2008 Thai Open Source Software Center Ltd
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+- Neither the name of the Thai Open Source Software Center Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+## Ant-Contrib Tasks
+
+[http://ant-contrib.sourceforge.net](http://ant-contrib.sourceforge.net)
+
+The *Ant-Contrib* project is a collection of tasks (and at one point maybe types and other tools) for Apache Ant.
+
+### License 
+
+This Software is distributed under the Apache Software License.
+
+## antSetLogLevel.jar
+
+GUI dialog for Ant tasks.
+
+Source: Deutsche Telekom
+
+
+
diff --git a/SDT/schema4.0/docs/SDT Build System.md b/SDT/schema4.0/docs/SDT Build System.md
new file mode 100644
index 0000000000000000000000000000000000000000..8a73e2a04cf18cc95d2255e07119bf2e0b34f34e
--- /dev/null
+++ b/SDT/schema4.0/docs/SDT Build System.md	
@@ -0,0 +1,73 @@
+# SDT Build System
+This document describes the SDT build system and how to build the SDT and validate new contributions.
+
+The files referenced in this document point to version **4.0** of the SDT.
+
+## Directory Structure and Important Files
+- [SDT/schema4.0/](../..) : Base directory
+- [SDT/schema4.0/src/](../src/) : Source files of the SDT.
+	- [domain.rng](../src/domain.rng) : RELAX NG file with the SDT schema definition. This is the source file that is converted to the actual schema definition *domain.xsd* during the build. See also [http://en.wikipedia.org/wiki/RELAX_NG](http://en.wikipedia.org/wiki/RELAX_NG).  
+	**Only edit this file when one wants to make changes to the SDT!**
+	- [domain.xsd](../src/domain.xsd) : The SDT schema definition that is generated from *domain.rng*.
+	- [xml.xsd](../src/xml.xsd) : General schema definitions for the SDT
+- [SDT/schema4.0/test/](../test/) : This directory contains all XML files with SDT definitions that should be validated whether they conform to the SDT schema. This could be example definitions or contributions.
+- [SDT/schema4.0/build.xml](../build.xml) : This is the definition file for the ant build system.
+- [SDT/schema4.0/etc/](../etc/), [SDT/schema4.0/style/](../style/) : internal directories for the build system. Please, don't make unnecessary changes to these files.
+- [SDT/schema4.0/etc/](../etc), [SDT/schema4.0/style/](../style/) : internal directories for the build system. Please, don't make unnecessary changes to these files.
+	- [SDT/schema4.0/etc/dal.rnc](../etc/dal.rnc) : This file contains various configuration parameter to convert the file [domain.rng](../src/domain.rng) to schema file. **The important parameter to change when changing the namespace or the version number is**:
+
+			default namespace xsl = "http://homegatewayinitiative.org/xml/dal/3.0"
+
+	- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml) : This file contains the header for the schema file. **This must be changed when changing the namespace or the version number.**
+- [SDT/schema4.0/lib/](../lib/) : Tasks for the ant-based build system. See also [SDT Build System Components and Licenses](SDT%20Build%20System%20Components%20and%20Licenses.md).
+
+## Installation
+- Install Java on your computer
+- Download and install Apache ant from [http://ant.apache.org](http://ant.apache.org)
+- Clone the SDT repository from GitHub:
+
+		$ git clone https://github.com/Homegateway/SmartDeviceTemplate.git
+	
+## How to Use the Build System
+After cloning the repository go to the directory *SDT/schema* and run commands depending on what you want to achieve.
+
+### Build the Schema
+Running *ant* without any parameter builds the schema definition from the rng-definition [SDT/schema4.0/src/domain.rng](../src/domain.rng) and writes it to [SDT/schema4.0/src/domain.xsd](../src/domain.xsd)
+
+	$ cd SDT/schema
+	$ ant
+
+### Validate SDT Definitions
+You can use the build system to validate new SDT definitions or changes made to existing ones by running the following command:
+
+	$ cd SDT/schema
+	$ ant validate
+
+The output after a successful validation should look like this:
+
+>[schemavalidate] 2 file(s) have been successfully validated.  
+>BUILD SUCCESSFUL  
+>Total time: 1 second
+
+Otherwise you most likely receive a stack trace or some other error messages. Search the output for the line *BUILD FAILED*. Above this line you will find some helpful hints for the filename and line number on which the error occurred (here: file *mseeb.xml* on line 66) and a reason:	
+
+>[schemavalidate] /Users/someone/Sources/git/SmartDeviceTemplate/SDT/schema/test/mseeb.xml:66:18: cvc-elt.1: Cannot find the declaration of element 'Domain'.    
+>BUILD FAILED
+
+---
+
+##  Editing
+As mentioned above, the actual schema definition is defined in the file [domain.rng](../src/domain.rng) and converted to the XML schema definition [domain.xsd](../src/domain.xsd) during the build process. 
+
+**All changes to the schema must therefore be made in [domain.rng](../src/domain.rng), NOT [domain.xsd](../src/domain.xsd) !**
+
+You may need to make additional changes in the following files, e.g. when the name space or the version number need to be adjusted.
+
+PLEASE ONLY EDIT THESE FILES IF NECESSARY. 
+
+- [SDT/schema4.0/build.xml](../build.xml)  
+e.g. in the *ant* target "validate"
+- [SDT/schema4.0/etc/dal.rnc](../etc/dal.rnc)  
+e.g. the entry "default namespace xsl"
+- [SDT/schema4.0/etc/schema.xmlns](../etc/schema.xmlns)
+- [SDT/schema4.0/etc/schemas.xml](../etc/schemas.xml)
diff --git a/SDT/schema4.0/docs/SDT_Components.md b/SDT/schema4.0/docs/SDT_Components.md
new file mode 100644
index 0000000000000000000000000000000000000000..bac78e0a486bdf17bfa377f36efe0921e021ef8e
--- /dev/null
+++ b/SDT/schema4.0/docs/SDT_Components.md
@@ -0,0 +1,496 @@
+# SDT Components
+
+[Domain](#Domain)  
+[Device](#Device) | [SubDevice](#SubDevice)  
+[Property](#Property)  
+[Module and ModuleClass](#ModuleClass)  
+&nbsp;&nbsp;&nbsp;[Action](#Action)  
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[Arg](#Arg)  
+&nbsp;&nbsp;&nbsp;[DataPoint](#DataPoint)  
+&nbsp;&nbsp;&nbsp;[Event](#Event)  
+[Data Types](#Data_Types)  
+&nbsp;&nbsp;&nbsp;[DataType](#DataType)  
+&nbsp;&nbsp;&nbsp;[Constraint](#Constraint)  
+&nbsp;&nbsp;&nbsp;[SimpleType](#SimpleType)  
+&nbsp;&nbsp;&nbsp;[StructType](#StructType)  
+&nbsp;&nbsp;&nbsp;[ArrayType](#ArrayType)  
+[Doc](#Documentation)  
+
+---
+
+
+## SDT Overview
+
+The following UML diagram presents an overview of the structure (elements) of every SDT which is conformant with these guidelines. As implied in the above descriptions, there can be many different choices of the details of a SDT, each one optimized for a particular market segment and the types of devices used in that market segment. Obviously an unnecessary proliferation is counter-productive, but as long as each SDT conforms to the structure shown below then it will be possible with little or modest effort for software to be adapted accordingly. 
+
+![](images/SDT_UML_Basic_Elements.png)
+
+The key to the diagram elements of the UML diagrams above and the snippets in the following sections:
+
+![](images/SDT_UML_Key.png)
+
+<a name="Domain"></a>
+
+The syntax used in the diagram to model an XML Schema Definition (XSD) as an UML diagram follows the following approaches:
+
+- [Design XML schemas using UML](http://www.ibm.com/developerworks/library/x-umlschem/)
+- [UML For W3C XML Schema Design](http://www.xml.com/pub/a/2002/08/07/wxs_uml.html)
+
+### Domain
+
+![](images/Domain.png)
+
+The *Domain* element allows labeling of different SDT templates for different technologies and/or industry segments ("verticals"): for example eHealth and Building Management might prefer quite different detailed structures/templates. This also helps keep information in human-friendly and manageable blocks. It is assumed that there will be multiple "SDT Templates" and some of them may be completely proprietary.
+
+It can also be used to collect all specified [ModuleClasses](#ModuleClasses)
+ and [Devices](#Devices) in one referencable logical group.
+
+#### Attributes
+- **id** : The identifier for that *Domain*. Required.
+
+#### Elements
+- **[Doc](#Documentation)** : Documentation for the *Domain*. Optional.
+- **Imports** : XML import/include of other XML files. Optional.
+- **[Module](#ModuleClass)** : A list of those *Module* components that are global to the whole domain. Optional.
+- **[Devices](#Device)** : a List of *Devices* components. Optional.
+
+#### Example
+
+	<Domain xmlns:xi="http://www.w3.org/2001/XInclude"
+    	xmlns="http://homegatewayinitiative.org/xml/dal/3.0" 
+    	id="org.homegatewayinitiative">
+		<Doc>Some documentation</Doc>
+    	<Imports>
+    		<!-- Import other SDTs via XInclude's include mechanism -->
+      		<xi:include href="./dal-core.xml" parse="xml" />
+    	</Imports>
+    	<Modules>
+    		<!-- List of Domain global Modules goes here -->
+    	</Modules>
+    	<Devices>
+    		<!-- List of Devices goes here -->
+		</Devices>
+	</Domain>
+
+---
+
+<a name="Device"/></a>
+### Device
+
+![](images/Device.png)
+
+The *Device* was initially thought of as the representation of "the basic things we are trying to model" and can still be considered so. However, after discussion with various SDOs, it was decided to add also "[sub-devices](#SubDevice)". That is, there is one level of hierarchy to allow modeling of e.g. a set of independent energy monitoring plugs in a single addressable power-extension-block. (Other SDOs might consider it more appropriate to use a recursive sub-sub-sub ... device definition). Note that all the different devices which one needs to model within a Domain are composed of one or more [Modules](#ModuleClass). 
+
+For each physical device on the network at least one *Device* **must** be defined. If the physical device is a simple device, i.e. it does not contain embedded devices, e.g. a light switch, it does not include further [SubDevices](#SubDevices). On the other hand, if the physical is a compound device, i.e. it does contain embedded devices that can be addressed separately, the *Device* **should** contain [SubDevices](SubDevices) for each of the identifiable embedded devices.
+
+An example for a compound device  is a connected power-strip where each of the sockets can be switched on and off individually. The power-strip itself can provide functions such as "all sockets off" and "overall power consumption".
+
+*Devices* may define their own [ModuleClasses](#ModuleClass) or refer to predefined ModulesClasses of the same or another [Domain](Domain).
+
+#### Attributes
+- **id** : The identifier for that *Device*. The identifier must be unique at least in the scope of the domain, but the final scope is also influenced by implementing technologies. Required.
+
+#### Elements
+
+- **[Doc](#Documentation)** : Documentation for the *Device*. Optional.
+- **[Properties](#Property)** : Further meta-data (or properties) about the *Device*. Optional.
+- **[Modules](#ModuleClass)** : A list of *Module* components that are local to the *Device*. Optional.
+- **[SubDevices](#SubDevice)** : A list of *SubDevice* components. Optional.
+
+#### Example
+
+	<Device id="aDevice">
+		<Doc>Some documentation</Doc>
+		<Properties>
+			<!-- The list of Properties for the Device goes here-->
+		</Properties>
+		<Modules>
+			<!-- List of Modules local to the Device goes here-->
+		</Modules>
+		<SubDevices>
+			<!-- List of Sub-Devices of the Device goes here-->
+		</SubDevices>
+	</Device>
+
+---
+
+<a name="SubDevice"/></a>
+### SubDevice
+*SubDevices* are optional components of a [Device](#Device). They represent physical sub-devices and services inside another device (the *Device*).
+
+*SubDevices* may define their own [ModuleClasses](#ModuleClass) or extend *ModuleClasses* of it's or another [Domain](#Domain).
+
+![](images/SubDevice.png)
+
+#### Attributes
+- **id** : The identifier for that *SubDevice*. The identifier must be unique at least in the scope of the domain, but the final scope is also influenced by implementing technologies. Required.
+
+#### Elements
+- **[Doc](#Documentation)** : Documentation for the *SubDevice*. Optional.
+- **[Properties](#Property)** : Further meta-data (or properties) about the *SubDevice*. Optional.
+- **[Modules](#ModuleClass)** : A list of *Module* components that are local to the *SubDevice*. Optional.
+
+#### Example
+
+	<SubDevice id="aSubDevice">
+		<Doc>Some documentation</Doc>
+		<Properties>
+			<!-- The list of Properties for the Device goes here-->
+		</Properties>
+		<Modules>
+			<!-- List of Modules local to the Device goes here-->
+		</Modules>
+	</SubDevice>
+
+---
+
+<a name="Property"/></a>
+### Property : Element of a *Device* or *ModuleClass*
+
+![](images/Property.png)
+
+*Property* elements are used to append to [Devices](#Device) and their [ModuleClass](ModuleClass) elements with arbitrary additional information. For [Devices](#Device) it would be very common for a manufacturer to want to add into the XML file which is describing the device such information as "Manufacturing Site", "Date of Manufacture", "Certification Code", "Energy Label Code", "compatible LAN technology", "URL for the device handbook", "physical limits of operation environments", etc.
+
+Some of that information might in some devices be available by reading a specific device [DataPoint](#DataPoint), however even if it cannot be read from the device then at least it can be noted in the device's XML description. Examples for organizations that specify these kind of added "Property" information are [eCl@ss](http://www.eclass.eu) and [UNSPSC](http://www.unspsc.org) (United Nations Standard Products and Services Code).
+
+Since the *Properties* are highly varied, depending on industry segment, no attempt is made in the SDT to constrain the options: however it is highly recommended to provide software-developer-friendly information in the [Doc](#Documentation) field of each Property. 
+
+#### Attributes
+- **name**: Name or identifier of a *Property*.
+- **optional**: Boolean that indicates whether a *Property* is optional or mandatory. Optional, the default is *false*.
+- **value**: Text representation of value of a *Property*. Optional.
+
+#### Elements
+- **[Doc](#Documentation)** : Documentation for the *Property*. Optional.
+- **DataType** : The data type of the property. This must be a [SimpleType](#SimpleType).
+
+#### Example
+	
+	<Property name="ManufacturedDate" value="2015.10.30 10:06">
+		<SimpleType type="datetime" />
+	</Property>
+
+---
+
+<a name="ModuleClass"/></a>
+### Module and ModuleClass
+
+![](images/ModuleClass.png)
+
+**Module**
+
+*Module* elements are basically constraints or templates for how to model functionality of real things/appliances/devices within the [Domain](#Domain). There could be an infinite number of possible functionalities, however it is recommended to identify a not-too-large selection of them as generic examples (called *"*ModuleClasses*, see below) and allow for additional proprietary extensions. In a particular [Domain](#Domain) there will be one *Module* for each of the agreed *ModuleClasses* plus additional ones for each extension of a *ModuleClass*.
+
+The advantage of identifying a subset of generic *ModuleClasses*, described below, is that any suitable high-level software would then be able to "parse" the generic functionality for all compliant appliances, even if the proprietary parts could not be interpreted by the software.
+
+Every [Device](#Device) can then be described by a collection of *Modules* (functionality). In the simplest examples, where there are no extensions needed, each *ModuleClass* has exactly one "child" Module ... in such cases the software developer can consider the two terms to be the same.
+
+The relationship between a *ModuleClass* and a *Module* is very similar to the specification of a class and an instantiated object in an object oriented programming language.
+
+**ModuleClass**
+
+The set of *ModuleClasses* is defined at the [Domain](#Domain) level. Each one describes some functionality (services). In principle there could be an infinite number of *ModuleClasses* (as noted above), for every kind of functionality found in UPnP, ZigBee and all the other automation protocols ... However that would not simplify the job of software developers at all! Therefore, HGI recommends that a finite and convenient number of prototypical *ModuleClasses* are re-used as much as possible (within a Domain at least). 
+
+Typical *ModuleClasses* might be equivalent to "power ON/OFF", "Open/Close", "PanUP/DOWN", "ReadTemperature", etc. Those examples make it apparent that various read/write usage of parameters, invoking of actions and waiting for events might be needed in the different *ModuleClasses*, and a guideline for those structures is explained below.
+
+#### Attributes
+- **name** : Name of the *Module* or *ModuleClass*. The name must be unique in the scope of the [Domain](#Domain). Required.
+- **optional**: Boolean that indicates whether a *Module* or *ModuleClass* is optional or mandatory. Optional, the default is *false*.
+
+#### Elements
+
+- **[Doc](#Documentation)** : Documentation for the *Module* or *ModuleClass*. Optional.
+- **extends** : Reference to a another *ModuleClass* or *Module* which is extended with this *ModuleClass*. Optional.  
+The element has the following attributes:
+	- **domain** : Identifier / Reference of the [Domain](#Domain) of the extended *ModuleClass*. Required for this element.
+	- **class** : Name of the *ModuleClass* in the [Domain](#Domain) that is extended. Required for this element.
+- **[Properties](#Property)** : Further meta-data (or properties) about the *Module* or *ModuleClass*. Optional.
+- **[Actions](#Action)** : A list of *Action* components, each defining a single action. Optional.
+- **[Data](#DataPoint)** : A list of *DataPoint* components. Optional.
+- **[Events](#Event)** : A list of *Event* components. Optional.
+
+#### Example
+
+	<ModuleClass name="BooleanState">
+		<Doc>Some documentation</Doc>
+		<Actions>
+			<!-- List of Actions goes here-->
+		</Actions>
+		<Events>
+			<!-- List of Events goes here-->
+		</Events
+		<Data>
+			<!-- List of DataPoints goes here-->
+		</Data>
+	</ModuleClass>
+
+---
+
+<a name="DataPoint"/></a>
+### DataPoint : Element of *ModuleClass* and *Event*
+
+![](images/DataPoint.png)
+
+A *DataPoint* element represents an aspect of a device which can be read/written to, and forms part of a device’s data model. Manipulating *DataPoints* is the most common way of controlling devices. Each *DataPoint* has an associated *type* (e.g. simple integer/real numbers, string of text, struct, or arrays thereof) which facillitates data integrity. Note that all RESTful systems (e.g. CoAP) use only *DataPoint* operations, so the mapping of a data models using an SDT into RESTful applications is easy.
+
+However, *DataPoints* are not the only way of controlling devices, so further [Actions](#Action) and [Events](#Event) are described below.
+
+Though *DataPoints* only refer to single data points of a physical device it is possible to describe hierarchies by model the path to the data point in the hierarchy by a path-like structure like to the pathname of a UNIX file system. Here, the root node of the hierarchy is a slash (/ 0x2F) and the segments or nodes along the path are also separated by slashes. The actual datapoint is the last leaf at the path. 
+
+In EBNF:
+
+	name          = dataPointName | "/" path ;  
+	path          = segment "/" path | dataPointName ;  
+	segment       = string ;  
+	dataPointName = string ;  
+	string        = (* character string excluding the character "/" *) ;
+
+
+#### Attributes
+- **name** : The name (and possible path in a hierarchical data model) of the *DataPoint*. The name must be unique in the scope of the [ModuleClass](#ModuleClass). Required.
+- **optional**: Boolean that indicates whether a *DataPoint* is optional or mandatory. Optional, the default is *false*.
+- **writable** : Boolean value that indicates whether this *DataPoint* is writable by an application. Optional. Default: true.
+- **readable** : Boolean value that indicates whether this *DataPoint* is readable by an application. Optional. Default: true.
+- **eventable** : Boolean value that indicates whether an internal or external change of this *DataPoint* raises an event. Optional. Default: false.
+
+#### Elements
+- **[Doc](#Documentation)** : Documentation for the *DataPoint*. Optional.
+- **[DataType](#DataType)** : The type of the *DataPoint*. It must comply to the *DataType* definition. Required.
+
+#### Example
+
+	<Data>
+		<DataPoint  name="attributeName" writable="false">
+			<Doc>Some documentation for the DataPoint</Doc>
+			<DataType>
+				<SimpleType type="string" />
+			</DataType
+		</DataPoint>
+	</Data>
+
+---
+
+<a name="Action"/></a>
+### Action : Element of *ModuleClass*
+
+![](images/Action.png)
+
+*Action* elements are an efficient way of describing arbitrary sequences of operations/methods; these are very common in automation. Typical example include "FactoryReset", and "AutoCalibrate". *Actions* preserve transaction integrity by putting together all the parameters ("args", see next section) with the method which checks and executes them, in one step.
+
+Note that systems which rely on RESTful operations need to carry out such complex setup-parameters-then-do-action by first using (several) [DataPoint](#DataPoint) operations to "load" the parameters to the device and then do a [DataPoint](#DataPoint) operation to manipulate the "start operation NOW" action.
+
+#### Attributes
+- **name** : The name of the *Action*. The name must be unique in the scope of the [ModuleClass](#ModuleClass). Required.
+- **optional**: Boolean that indicates whether an *Action* is optional or mandatory. Optional, the default is *false*.
+
+#### Elements
+- **[Doc](#Documentation)** : Documentation for the *Action*. Optional.
+- **[DataType](#DataType)** : The return type of the *Action*. It must comply to the *DataType* definition. Optional. If no *DataType* is specified the *Action* does not return a value.
+- **Args** : Zero or more occurances of [argument](#Arg) definitions for an *Action*. Optional.
+
+<a name="ActionExample"/></a>
+#### Example
+The following are two examples for actions implementing a getter and a setter for boolean values.
+
+	<Action name="get" type="boolean">
+		<Doc>Obtain the current associated state. Example of a getter.</Doc>
+	</Action>
+
+	<Action name="setTarget">
+		<Doc>Set the associated state to the specified value. Example of a setter.</Doc>
+		<Args>
+			<Arg name="value">
+	    		<Doc>The desired value of the associated state.</Doc>
+	    		<DataType>
+	    			<SimpleType type="boolean" />
+	    		</DataType>
+	    	</Arg>
+	    </Args>
+	</Action>
+
+---
+
+<a name="Event"/></a>
+### Event : Element of *ModuleClass*
+
+![](images/Event.png)
+
+*Event* elements are needed for automation protocols which "push" information, instead of relying on polling by the software application. A typical example would be a "SensorAlert" where a window sensor immediately transmits a change of its state from "closed" to "open", which could be used in a burglar alarm application, needs to be ready to accept such information immediately, and not wait for a regular polling of the device.
+
+#### Attributes
+- **name** : The name of the *Event*. The name must be unique in the scope of the [ModuleClass](#ModuleClass). Required.
+- **optional**: Boolean that indicates whether an *Event* is optional or mandatory. Optional, the default is *false*.
+
+#### Elements
+- **[Doc](#Documentation)** : Documentation for the *Event* Element. Optional.
+- **[Data](#DataPoint)** : A list of *DataPoint* components for an event's payload. Optional.
+
+#### Example
+
+	<Event name="stateChanged">
+		<Doc>Some documentation for the Event</Doc>
+		<Data>
+			<DataPoint name="state">
+				<DataType>
+					<SimpleType type="boolean" />
+				</DataType>
+			</DataPoint>
+		</Data>
+	</Event>
+
+---
+
+<a name="Arg"/></a>
+### Arg : Element of *Action*
+
+![](images/Arg.png)
+ 
+The *Arg* element represents the parameter information which a device needs to carry out a required *Action*. 
+
+The *Arg* has the following attributes and elements:
+
+#### Attributes
+- **name** : The name of the *Arg* attribute. Required.
+
+#### Elements
+- **[Doc](#Documentation)** : Documentation for the *argument*. Optional.
+- **[DataType](#DataType)** : The return type of the *argument*. It must comply to the *DataType* definition. Required.
+
+#### Example
+See [example above](#ActionExample).
+
+---
+
+<a name="Data_Types"/></a>
+### DataType
+The data type can be simple integers or string text, or rather complex, as shown below:
+
+![](images/SDT_UML_DataType.png)
+
+The various elements are described in the sections below.
+
+![](images/DataType.png)
+
+The *DataType* element is a "container" for the various aspects of a type. 
+
+#### Attributes
+- **name** : The name of the *DataType*. The name must be set for the [Struct](#Struct) types to distinguish individual fields in that structure. It can be used in other cases. Optional.
+- **unitOfMeasure** : Before considering the type of data in detail, there is the option to label the data with the units of measurement.  A "Temperature" measurement is meaningless until the units Kelvin, Celcius, Fahrenheit etc are known. Because of the extreme variety of units, a string field is the default annotation method, although of course a SDO could decide to reference a standardized list of units. Optional.
+
+#### Elements
+- **[Doc](#Documentation)** : Documentation for the *DataType* Element. Optional.
+- **TypeChoice** : This element is actual an element from the following list of data types:
+	- **[SimpleType](#SimpleType)**
+	- **[Struct](#StructType)**
+	- **[Array](#ArrayType)**
+- **[Constraint](#Constraint)** : A list of *Constraint* elements. Optional.
+
+---
+
+<a name="Constraint"/></a>
+### Constraint : Element of DataType
+
+![](images/Constraint.png)
+
+The *Constraint* element is an optional element allowing the manufacturer to provide constraints on the permitted values of measured data or input parameters. It can significantly improve the reliability of software and validation of transmitted data.
+
+#### Attributes
+- **name** : The name or ID that identifies the *Constraint*. Required.
+- **type** : The basic data type of the constraint. Note that this may be different from the type of the [DataType](#DataType) that this *Constraint* is assigned to. For example, a *Constraint* that specifies a maximum length of a string is of type *integer*. Optional.
+- **value** : A pre-assigned value for the constraint, for example the maximum number of characters in a string. Optional.
+
+#### Elements
+- **[Doc](#Documentation)** : Documentation for the *Cosntraint* Element. Optional.
+
+---
+
+### TypeChoice : Construct of *DataType*
+ 
+ ![](images/TypeChoice.png)
+
+The *TypeChoice* construct is required for syntactic reasons in the UML diagram and the choice from the enumerated list simply designates the complexity of the following DataType.
+
+---
+
+<a name="SimpleType"/></a>
+### SimpleType : Element of *TypeChoice*
+
+![](images/SimpleType.png)
+
+The *SimpleType* element is required in order for software to understand the format of the associated data, e.g. are the bytes an integer or real value? The selection choosen by HGI is based on practical experience to include some specific types which are slightly more complex:
+
+1. the (technically redundant) options of *date* and *time* - to avoid problems which can arise interpreting a *datetime* value; 
+2. *url* because it is expected to become extremely common to provide links to other data sources; 
+3. the "blob" type to represent binary data of arbitrary structure.
+
+If not stated otherwise datatypes should comply to the equivalent datatypes defined in [XML Schema Part 2: Datatypes Second Edition](http://www.w3.org/TR/xmlschema-2/#boolean):
+
+- **boolean** : A boolean value as defined in [http://www.w3.org/TR/xmlschema-2/#boolean](http://www.w3.org/TR/xmlschema-2/#boolean) .
+- **byte** : An integer datatype with the range of [0 - 255] as defined in [http://www.w3.org/TR/xmlschema-2/#unsignedByte](http://www.w3.org/TR/xmlschema-2/#unsignedByte) .
+- **integer** : An integer value as defined in [http://www.w3.org/TR/xmlschema-2/#integer](http://www.w3.org/TR/xmlschema-2/#integer) .
+- **float** : An IEEE single-precision 32-bit floating point type as defined in [http://www.w3.org/TR/xmlschema-2/#float](http://www.w3.org/TR/xmlschema-2/#float) .
+- **string** : The string datatype represents character strings as defined in [http://www.w3.org/TR/xmlschema-2/#string](http://www.w3.org/TR/xmlschema-2/#string) .
+- **enum** : A complete and orderd list of items in a collection. Items in an enumeration are separated by commas (, 0x2c) and must be of one of the datatypes defined here. Commas (, 0x2c) and backslashes (\ 0x5c) in enumaration items must be escaped by backslash.
+- **date** : A date value as defined in [http://www.w3.org/TR/xmlschema-2/#date](http://www.w3.org/TR/xmlschema-2/#date) .
+- **time** : A time value as defined in [http://www.w3.org/TR/xmlschema-2/#time](http://www.w3.org/TR/xmlschema-2/#time) .
+- **datetime** : A time value as defined in [http://www.w3.org/TR/xmlschema-2/#dateTime](http://www.w3.org/TR/xmlschema-2/#dateTime) .
+- **blob** : A blob value represents a binary object. The internal encoding is transparent and not defined here. The binary object must be encoded conforming to [http://www.w3.org/TR/xmlschema-2/#base64Binary](http://www.w3.org/TR/xmlschema-2/#base64Binary) .
+- **uri** : A URI that represents a Uniform Resource Identifier Reference (URI) as defined by as defined in [RFC 2396](http://www.ietf.org/rfc/rfc2396.txt) and amended in [RFC 2732](http://www.ietf.org/rfc/rfc2732.txt) .
+
+---
+
+<a name="StructType"/></a>
+### StructType : Element of *TypeChoice*
+
+![](images/Struct.png)
+
+The *StructType* element can be used to represent an ordered list of diverse DataTypes, which are represented by the *name* attribute of each [DataType](#DataType), and can be used recursively. 
+
+#### Elements
+- **[DataType](#DataType)** : A list of DataTypes elements representing the elements of a structure.
+
+
+---
+
+<a name="ArrayType"/></a>
+### ArrayType : Element of *TypeChoice*
+
+![](images/Array.png)
+
+The *ArrayType* element is provided for defining lists of data; the definition is recursive so that multi-dimensional arrays can be described. Note that a Constraint can be used to provide limits on Array size.
+
+#### Elements
+- **[DataType](#DataType)** : A single DataType element that specifies the data type for the elements of the array.
+
+---
+
+<a name="Documentation"/></a>
+### Doc : Element for all Documentation
+
+![](images/Doc.png)
+
+*Doc* elements (optional for all the above Elements) are very important to help understand the software-readable information for specific devices and services. They contain the human-readable information. Many automation protocols describe every possible operation in a comprehensive specification, however SDT is designed to include the relevant information at the "point of use" for the software developer, inside the SDT (and XML files based on it).
+
+The text inside the *Doc* element can be structure using a very limited subset of HTML elements. The possible structuring is defined in EBNF as follows:
+
+
+	Doc            = "<Doc>" docContent "</Doc" ;
+	docContent     = docText | { paragraph | image } ;
+	docText        = { text | emphasizedText | boldText | monotypeText } ;
+	emphasizedText = "<em>" text "</em>" ;
+	boldText       = "<b>" text "</b>" ;
+	monotypeText   = "<tt>" text "</tt>" ;
+	paragraph      = "<p>" docText "</p>" ;
+	image          = "<img src=" url ">" "<caption>" text "</caption>" "</img>" ;
+	url            = "\"" (* valid URL *) "\"" ;
+	text           = (* XML text element *) ;
+
+
+The intended use for each element is:
+
+- **emphasizedText** : Emphasize the included text, e.g. printing it in italics font.
+- **boldText** : Print the included text in bold font.
+- **monotypeText** : Print the included text in a monospaced fonttype, e.g. to emphasize source code.
+- **paragraph** : Structure the text in paragraphs.
+- **image** : Include an image in the text. The image is loaded from the specified URL and must include a caption text.
+
diff --git a/SDT/schema4.0/docs/SDT_UML.uxf b/SDT/schema4.0/docs/SDT_UML.uxf
new file mode 100644
index 0000000000000000000000000000000000000000..8b3bbd81f80f57359b4faf427b12edd6100229a5
--- /dev/null
+++ b/SDT/schema4.0/docs/SDT_UML.uxf
@@ -0,0 +1,711 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<diagram program="umlet" version="13.3">
+  <help_text/>
+  <zoom_level>7</zoom_level>
+  <element>
+    <id>UMLNote</id>
+    <coordinates>
+      <x>21</x>
+      <y>427</y>
+      <w>217</w>
+      <h>182</h>
+    </coordinates>
+    <panel_attributes>bg=#FAF8C8
+fontsize=12
+/@ optional elementAttribute/
+/@ optional elementAttribute = default value/
+*@ mandatoryElementAttribute*
+- mandatory element : Subclass  (exact one)
+/- optionalElement : SubClass      (zero or one)/
+/* optionalElement : SubClass      (zero or many)/
+
+"Depends" Relation
+and Cardinality
+
+Subclassing
+
+Cardinalities:
+0,1  : zero or one
+1     : exact one
+0..* : zero or many
+1..* : at least one or many
+</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>105</x>
+      <y>497</y>
+      <w>77</w>
+      <h>28</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+fontsize=10
+m1=0..*
+</panel_attributes>
+    <additional_attributes>90.0;20.0;10.0;20.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>105</x>
+      <y>525</y>
+      <w>77</w>
+      <h>21</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;-
+fontsize=10</panel_attributes>
+    <additional_attributes>90.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>651</x>
+      <y>770</y>
+      <w>105</w>
+      <h>154</h>
+    </coordinates>
+    <panel_attributes>&lt;&lt;enumeration&gt;&gt;
+BasicType
+--
+boolean
+byte
+integer
+float
+string
+enum
+date
+time
+datetime
+blob
+uri</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>357</x>
+      <y>833</y>
+      <w>98</w>
+      <h>56</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;.
+m1= 0,1
+</panel_attributes>
+    <additional_attributes>120.0;50.0;60.0;50.0;60.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>357</x>
+      <y>777</y>
+      <w>98</w>
+      <h>56</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;.
+m1= 0,1
+</panel_attributes>
+    <additional_attributes>120.0;10.0;40.0;10.0;40.0;60.0;10.0;60.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>21</x>
+      <y>777</y>
+      <w>133</w>
+      <h>84</h>
+    </coordinates>
+    <panel_attributes>DataType
+--
+/@ name : text/
+/@ unitOfMeasure : text/
+/- Doc : Doc/
+- TypeChoice
+/* Constraints : Constraint/
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>126</x>
+      <y>735</y>
+      <w>490</w>
+      <h>91</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;.
+m2=1..*
+</panel_attributes>
+    <additional_attributes>10.0;60.0;10.0;20.0;680.0;20.0;680.0;100.0;640.0;100.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>126</x>
+      <y>735</y>
+      <w>490</w>
+      <h>133</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;.
+m2=1
+</panel_attributes>
+    <additional_attributes>10.0;60.0;10.0;20.0;680.0;20.0;680.0;160.0;640.0;160.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>441</x>
+      <y>861</y>
+      <w>133</w>
+      <h>35</h>
+    </coordinates>
+    <panel_attributes>SimpleType
+--
+*@ type : BasicType*
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>567</x>
+      <y>875</y>
+      <w>98</w>
+      <h>35</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;-
+m1= 1
+</panel_attributes>
+    <additional_attributes>120.0;20.0;10.0;20.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>441</x>
+      <y>917</y>
+      <w>133</w>
+      <h>70</h>
+    </coordinates>
+    <panel_attributes>Constraint
+--
+*@ name : text*
+/@ type : BasicType/
+/@ value : text/
+/- Doc : Doc/
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>147</x>
+      <y>847</y>
+      <w>308</w>
+      <h>98</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1=0..*
+</panel_attributes>
+    <additional_attributes>420.0;110.0;340.0;110.0;340.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>567</x>
+      <y>917</y>
+      <w>147</w>
+      <h>56</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;-
+m1=1
+</panel_attributes>
+    <additional_attributes>190.0;10.0;190.0;60.0;10.0;60.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>441</x>
+      <y>777</y>
+      <w>133</w>
+      <h>35</h>
+    </coordinates>
+    <panel_attributes>StructType
+--
+- DataType : DataType
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>441</x>
+      <y>819</y>
+      <w>133</w>
+      <h>35</h>
+    </coordinates>
+    <panel_attributes>ArrayType
+--
+- DataType : DataType
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>357</x>
+      <y>812</y>
+      <w>98</w>
+      <h>35</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;.
+m1= 0,1
+
+</panel_attributes>
+    <additional_attributes>120.0;20.0;10.0;20.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>21</x>
+      <y>672</y>
+      <w>735</w>
+      <h>28</h>
+    </coordinates>
+    <panel_attributes>halign=center
+SDT 3.0 - DataType
+fontsize=24
+bg=gray
+lw=0.1</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>21</x>
+      <y>7</y>
+      <w>840</w>
+      <h>28</h>
+    </coordinates>
+    <panel_attributes>SDT 3.0 - Basic Elements
+halign=center
+fontsize=24
+bg=gray
+lw=0.1</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>259</x>
+      <y>126</y>
+      <w>154</w>
+      <h>133</h>
+    </coordinates>
+    <panel_attributes>ModuleClass
+--
+*@ name : text*
+/@ optional : boolean = false/
+/- Doc : Doc/
+/- extends/
+/   @domain : IDRF/
+/   @class : text /
+/* Properties : Property/
+/* Actions : Action/
+/* Data : DataPoint/
+/* Events : Event/
+fg=blue
+</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>497</x>
+      <y>126</y>
+      <w>154</w>
+      <h>77</h>
+    </coordinates>
+    <panel_attributes>Action
+--
+*@ name : text*
+/@ optional : boolean = false/
+/- Doc : Doc/
+/- DataType : DataType/
+/* Args : Arg/
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>742</x>
+      <y>189</y>
+      <w>119</w>
+      <h>56</h>
+    </coordinates>
+    <panel_attributes>Arg
+--
+*@ name ; text*
+/- Doc : Doc/
+- DataType : DataType
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>644</x>
+      <y>189</y>
+      <w>112</w>
+      <h>28</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1= 0..*</panel_attributes>
+    <additional_attributes>140.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>21</x>
+      <y>126</y>
+      <w>154</w>
+      <h>77</h>
+    </coordinates>
+    <panel_attributes>Domain
+--
+*@ id : ID*
+/- Doc : Doc/
+/* imports/
+/* Modules : ModuleClass/
+/* Devices : Device/
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>168</x>
+      <y>126</y>
+      <w>105</w>
+      <h>63</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1= 0..*</panel_attributes>
+    <additional_attributes>130.0;10.0;50.0;10.0;50.0;70.0;10.0;70.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>21</x>
+      <y>308</y>
+      <w>154</w>
+      <h>70</h>
+    </coordinates>
+    <panel_attributes>SubDevice
+--
+*@ id : Name*
+/- Doc : Doc/
+/* Properties : Property/
+/* Modules : Module/
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>168</x>
+      <y>182</y>
+      <w>49</w>
+      <h>63</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1=0..*
+</panel_attributes>
+    <additional_attributes>10.0;60.0;50.0;60.0;50.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>168</x>
+      <y>315</y>
+      <w>105</w>
+      <h>49</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1= 0..*</panel_attributes>
+    <additional_attributes>130.0;10.0;60.0;10.0;60.0;50.0;10.0;50.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>742</x>
+      <y>357</y>
+      <w>119</w>
+      <h>35</h>
+    </coordinates>
+    <panel_attributes>Doc
+--
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>406</x>
+      <y>126</y>
+      <w>105</w>
+      <h>42</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1= 0..*
+</panel_attributes>
+    <additional_attributes>130.0;10.0;50.0;10.0;50.0;40.0;10.0;40.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>686</x>
+      <y>350</y>
+      <w>70</w>
+      <h>35</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1=0,1
+</panel_attributes>
+    <additional_attributes>80.0;20.0;10.0;20.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>406</x>
+      <y>161</y>
+      <w>105</w>
+      <h>84</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1= 0..*
+</panel_attributes>
+    <additional_attributes>130.0;90.0;50.0;90.0;50.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>497</x>
+      <y>217</y>
+      <w>154</w>
+      <h>98</h>
+    </coordinates>
+    <panel_attributes>DataPoint
+--
+*@ name : text*
+/@ optional : boolean = false/
+/@ writable : boolean = true/
+/@ readable : boolean = true/
+/@ eventable : boolean = false/
+/- Doc : Doc/
+- DataType : DataType
+
+fg=blue
+</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>497</x>
+      <y>329</y>
+      <w>154</w>
+      <h>63</h>
+    </coordinates>
+    <panel_attributes>Event
+--
+*@ name : text*
+/@ optional : boolean = false/
+/- Doc : Doc/
+/* Data : DataPoint/
+
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>406</x>
+      <y>231</y>
+      <w>105</w>
+      <h>126</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1= 0..*
+</panel_attributes>
+    <additional_attributes>130.0;150.0;80.0;150.0;80.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>259</x>
+      <y>280</y>
+      <w>154</w>
+      <h>21</h>
+    </coordinates>
+    <panel_attributes>Module
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>168</x>
+      <y>280</y>
+      <w>105</w>
+      <h>98</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+
+</panel_attributes>
+    <additional_attributes>130.0;10.0;80.0;10.0;80.0;120.0;10.0;120.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>322</x>
+      <y>252</y>
+      <w>21</w>
+      <h>42</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;-
+</panel_attributes>
+    <additional_attributes>10.0;10.0;10.0;40.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>21</x>
+      <y>217</y>
+      <w>154</w>
+      <h>77</h>
+    </coordinates>
+    <panel_attributes>Device
+--
+*@ id : Name*
+/- Doc : Doc/
+/* Properties : Property/
+/* Modules : Module/
+/* SubDevices : SubDevice/
+fg=blue</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>168</x>
+      <y>280</y>
+      <w>49</w>
+      <h>56</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1=0..*
+</panel_attributes>
+    <additional_attributes>10.0;50.0;40.0;50.0;40.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>168</x>
+      <y>252</y>
+      <w>105</w>
+      <h>56</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1= 0..*
+</panel_attributes>
+    <additional_attributes>130.0;50.0;80.0;50.0;80.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>168</x>
+      <y>266</y>
+      <w>105</w>
+      <h>70</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.</panel_attributes>
+    <additional_attributes>130.0;80.0;60.0;80.0;60.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>259</x>
+      <y>315</y>
+      <w>154</w>
+      <h>77</h>
+    </coordinates>
+    <panel_attributes>Property
+--
+*@ name : text*
+/@ optional : boolean = false/
+/@ value : text/
+/- Doc : Doc/
+- DataType : SimpleType
+fg=blue
+transparency=80</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>644</x>
+      <y>217</y>
+      <w>56</w>
+      <h>147</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1=0..*
+</panel_attributes>
+    <additional_attributes>10.0;10.0;60.0;10.0;60.0;190.0;10.0;190.0</additional_attributes>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>406</x>
+      <y>245</y>
+      <w>49</w>
+      <h>98</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;.
+m1=0..*</panel_attributes>
+    <additional_attributes>10.0;110.0;50.0;110.0;50.0;10.0;10.0;10.0</additional_attributes>
+  </element>
+  <element>
+    <id>UMLClass</id>
+    <coordinates>
+      <x>231</x>
+      <y>777</y>
+      <w>133</w>
+      <h>70</h>
+    </coordinates>
+    <panel_attributes>&lt;&lt;enumeration&gt;&gt;
+TypeChoice
+--
+SimpleType : SimpleType
+Struct : StructType
+Array : ArrayType 
+
+</panel_attributes>
+    <additional_attributes/>
+  </element>
+  <element>
+    <id>Relation</id>
+    <coordinates>
+      <x>147</x>
+      <y>784</y>
+      <w>98</w>
+      <h>63</h>
+    </coordinates>
+    <panel_attributes>lt=&lt;&lt;-
+m1= 1
+</panel_attributes>
+    <additional_attributes>120.0;10.0;80.0;10.0;80.0;70.0;10.0;70.0</additional_attributes>
+  </element>
+</diagram>
diff --git a/SDT/schema4.0/docs/UML Diagram.md b/SDT/schema4.0/docs/UML Diagram.md
new file mode 100644
index 0000000000000000000000000000000000000000..15a0f0b5cf5bc944ed25fb07b925157e027fc1aa
--- /dev/null
+++ b/SDT/schema4.0/docs/UML Diagram.md	
@@ -0,0 +1,14 @@
+# UML Diagram of the SDT 4.0
+
+The source for the diagrams below is [here](SDT_UML.uxf).
+## Basic Elements
+
+![](images/SDT_UML_Basic_Elements.png)
+
+## Data Types
+
+![](images/SDT_UML_DataType.png)
+
+## Key
+
+![](images/SDT_UML_Key.png)
diff --git a/SDT/schema4.0/docs/images/Action.png b/SDT/schema4.0/docs/images/Action.png
new file mode 100644
index 0000000000000000000000000000000000000000..e0ef5763eb818538d8e0652652e79c221e7eedbd
Binary files /dev/null and b/SDT/schema4.0/docs/images/Action.png differ
diff --git a/SDT/schema4.0/docs/images/Arg.png b/SDT/schema4.0/docs/images/Arg.png
new file mode 100644
index 0000000000000000000000000000000000000000..4df9eb09ff0855c2523e8fb2f31448a44d675d9b
Binary files /dev/null and b/SDT/schema4.0/docs/images/Arg.png differ
diff --git a/SDT/schema4.0/docs/images/Array.png b/SDT/schema4.0/docs/images/Array.png
new file mode 100644
index 0000000000000000000000000000000000000000..6935adc0c1390c7cfd08bd4593f83b9f0b545db6
Binary files /dev/null and b/SDT/schema4.0/docs/images/Array.png differ
diff --git a/SDT/schema4.0/docs/images/Constraint.png b/SDT/schema4.0/docs/images/Constraint.png
new file mode 100644
index 0000000000000000000000000000000000000000..4293b90e6c7c8224987fb836a703072bb625acfb
Binary files /dev/null and b/SDT/schema4.0/docs/images/Constraint.png differ
diff --git a/SDT/schema4.0/docs/images/DataPoint.png b/SDT/schema4.0/docs/images/DataPoint.png
new file mode 100644
index 0000000000000000000000000000000000000000..69ca53b5cdde67940fd3e584fdb6ef807bc3d9bf
Binary files /dev/null and b/SDT/schema4.0/docs/images/DataPoint.png differ
diff --git a/SDT/schema4.0/docs/images/DataType.png b/SDT/schema4.0/docs/images/DataType.png
new file mode 100644
index 0000000000000000000000000000000000000000..331498883c24a8d3160603b0725a25d5bac18eac
Binary files /dev/null and b/SDT/schema4.0/docs/images/DataType.png differ
diff --git a/SDT/schema4.0/docs/images/Device.png b/SDT/schema4.0/docs/images/Device.png
new file mode 100644
index 0000000000000000000000000000000000000000..39ac44b0ab73abcabae53fbaf6641aba0dd3da50
Binary files /dev/null and b/SDT/schema4.0/docs/images/Device.png differ
diff --git a/SDT/schema4.0/docs/images/Doc.png b/SDT/schema4.0/docs/images/Doc.png
new file mode 100644
index 0000000000000000000000000000000000000000..0f7d8b85950d71c4eae562ef2565b31503cf9012
Binary files /dev/null and b/SDT/schema4.0/docs/images/Doc.png differ
diff --git a/SDT/schema4.0/docs/images/Domain.png b/SDT/schema4.0/docs/images/Domain.png
new file mode 100644
index 0000000000000000000000000000000000000000..1b70166e755a694b0ee73d171dd59e8c25c2a7e9
Binary files /dev/null and b/SDT/schema4.0/docs/images/Domain.png differ
diff --git a/SDT/schema4.0/docs/images/Event.png b/SDT/schema4.0/docs/images/Event.png
new file mode 100644
index 0000000000000000000000000000000000000000..7506c40b4d3387733195ca2242de40837f05fb46
Binary files /dev/null and b/SDT/schema4.0/docs/images/Event.png differ
diff --git a/SDT/schema4.0/docs/images/MC.Action.DataPoint.Event.png b/SDT/schema4.0/docs/images/MC.Action.DataPoint.Event.png
new file mode 100644
index 0000000000000000000000000000000000000000..057d2b288cfa5293c782f0106e52b288daf7e59f
Binary files /dev/null and b/SDT/schema4.0/docs/images/MC.Action.DataPoint.Event.png differ
diff --git a/SDT/schema4.0/docs/images/MC.Action.DataPoint.png b/SDT/schema4.0/docs/images/MC.Action.DataPoint.png
new file mode 100644
index 0000000000000000000000000000000000000000..0ea95b8f1912e93923d2827a2231ada11a567b1d
Binary files /dev/null and b/SDT/schema4.0/docs/images/MC.Action.DataPoint.png differ
diff --git a/SDT/schema4.0/docs/images/ModuleClass.png b/SDT/schema4.0/docs/images/ModuleClass.png
new file mode 100644
index 0000000000000000000000000000000000000000..1878593c1d8999ba7e891c77d6494489d8b1dbee
Binary files /dev/null and b/SDT/schema4.0/docs/images/ModuleClass.png differ
diff --git a/SDT/schema4.0/docs/images/Property.png b/SDT/schema4.0/docs/images/Property.png
new file mode 100644
index 0000000000000000000000000000000000000000..89581586826c13719185f3ad75aad5392efdd6e6
Binary files /dev/null and b/SDT/schema4.0/docs/images/Property.png differ
diff --git a/SDT/schema4.0/docs/images/SDT3.0_UML.png b/SDT/schema4.0/docs/images/SDT3.0_UML.png
new file mode 100644
index 0000000000000000000000000000000000000000..c487167f0f1f30644d1ac4b813d5b9a92f14acf9
Binary files /dev/null and b/SDT/schema4.0/docs/images/SDT3.0_UML.png differ
diff --git a/SDT/schema4.0/docs/images/SDT_UML_Basic_Elements.png b/SDT/schema4.0/docs/images/SDT_UML_Basic_Elements.png
new file mode 100644
index 0000000000000000000000000000000000000000..98121276a51889da2c842e80ddfd50a1a807ae0a
Binary files /dev/null and b/SDT/schema4.0/docs/images/SDT_UML_Basic_Elements.png differ
diff --git a/SDT/schema4.0/docs/images/SDT_UML_DataType.png b/SDT/schema4.0/docs/images/SDT_UML_DataType.png
new file mode 100644
index 0000000000000000000000000000000000000000..3b6a4016b5f3de1a2f8717b8f04f8d6f5a5ee327
Binary files /dev/null and b/SDT/schema4.0/docs/images/SDT_UML_DataType.png differ
diff --git a/SDT/schema4.0/docs/images/SDT_UML_Key.png b/SDT/schema4.0/docs/images/SDT_UML_Key.png
new file mode 100644
index 0000000000000000000000000000000000000000..88b15e3a83759d499bb639b6bd38d11f70dcc0fe
Binary files /dev/null and b/SDT/schema4.0/docs/images/SDT_UML_Key.png differ
diff --git a/SDT/schema4.0/docs/images/SDT_simplified.png b/SDT/schema4.0/docs/images/SDT_simplified.png
new file mode 100644
index 0000000000000000000000000000000000000000..041738b3536a9d7454aaf2a024f0c76a8c33a22e
Binary files /dev/null and b/SDT/schema4.0/docs/images/SDT_simplified.png differ
diff --git a/SDT/schema4.0/docs/images/SimpleType.png b/SDT/schema4.0/docs/images/SimpleType.png
new file mode 100644
index 0000000000000000000000000000000000000000..3e7d5b08ef7747985a993fec9d87da5374d23397
Binary files /dev/null and b/SDT/schema4.0/docs/images/SimpleType.png differ
diff --git a/SDT/schema4.0/docs/images/Struct.png b/SDT/schema4.0/docs/images/Struct.png
new file mode 100644
index 0000000000000000000000000000000000000000..854645418669bd142b8637443a6516b7eb6548c4
Binary files /dev/null and b/SDT/schema4.0/docs/images/Struct.png differ
diff --git a/SDT/schema4.0/docs/images/SubDevice.png b/SDT/schema4.0/docs/images/SubDevice.png
new file mode 100644
index 0000000000000000000000000000000000000000..e77637fd4681b6b6076e93d6bf9654f7b2499b84
Binary files /dev/null and b/SDT/schema4.0/docs/images/SubDevice.png differ
diff --git a/SDT/schema4.0/docs/images/TypeChoice.png b/SDT/schema4.0/docs/images/TypeChoice.png
new file mode 100644
index 0000000000000000000000000000000000000000..3606b755f4bb18642f60f49f481a572b99a508ab
Binary files /dev/null and b/SDT/schema4.0/docs/images/TypeChoice.png differ
diff --git a/SDT/schema4.0/etc/XInclude.xsd b/SDT/schema4.0/etc/XInclude.xsd
new file mode 100644
index 0000000000000000000000000000000000000000..8fbe0c8ee4a086074cdca852f6a5b656d73bcd05
--- /dev/null
+++ b/SDT/schema4.0/etc/XInclude.xsd
@@ -0,0 +1,49 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           xmlns:xi="http://www.w3.org/2001/XInclude"
+           targetNamespace="http://www.w3.org/2001/XInclude"
+           finalDefault="extension">
+  <xs:annotation>
+   <xs:documentation>
+    Not normative, but may be useful.
+    See the REC http://www.w3.org/TR/XInclude for definitive
+    information about this namespace.
+   </xs:documentation>
+  </xs:annotation>
+
+  <xs:element name="include" type="xi:includeType" />
+
+  <xs:complexType name="includeType" mixed="true">
+    <xs:choice minOccurs='0' maxOccurs='unbounded' >
+      <xs:element ref='xi:fallback' />
+      <xs:any namespace='##other' processContents='lax' />
+      <xs:any namespace='##local' processContents='lax' />
+    </xs:choice>
+    <xs:attribute name="href" use="optional" type="xs:anyURI"/>
+    <xs:attribute name="parse" use="optional" default="xml"
+                  type="xi:parseType" />
+    <xs:attribute name="xpointer" use="optional" type="xs:string"/>
+    <xs:attribute name="encoding" use="optional" type="xs:string"/>
+    <xs:attribute name="accept" use="optional" type="xs:string"/>
+    <xs:attribute name="accept-language" use="optional" type="xs:string"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+  </xs:complexType>
+
+  <xs:simpleType name="parseType">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="xml"/>
+      <xs:enumeration value="text"/>
+    </xs:restriction>
+  </xs:simpleType>
+  
+  <xs:element name="fallback" type="xi:fallbackType" />
+
+  <xs:complexType name="fallbackType" mixed="true">
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="xi:include"/>
+      <xs:any namespace="##other" processContents="lax"/>
+      <xs:any namespace="##local" processContents="lax"/>
+    </xs:choice>
+    <xs:anyAttribute namespace="##other" processContents="lax" />
+  </xs:complexType>
+
+</xs:schema>
diff --git a/SDT/schema4.0/etc/XMLSchema-datatypes.xsd b/SDT/schema4.0/etc/XMLSchema-datatypes.xsd
new file mode 100644
index 0000000000000000000000000000000000000000..574949db19c49daca2077543c9c30c73d427068b
--- /dev/null
+++ b/SDT/schema4.0/etc/XMLSchema-datatypes.xsd
@@ -0,0 +1,154 @@
+<?xml version='1.0'?>
+<!-- XML Schema schema for XML Schemas: Part 2: Datatypes -->
+<!DOCTYPE schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [
+<!ENTITY % s ''>
+<!ENTITY % p ''>
+]>
+<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2001/XMLSchema-datatypes"
+	version="$Id: XMLSchema-datatypes.xsd,v 1.5 2001/03/16 20:53:32 ht Exp $">
+  <annotation>
+   <documentation>Note this schema is NOT a normative schema - -
+     It contains types derived from all the builtin simple type definitions
+     with the same local name but in a distinct namespace, for use
+     by applications which do no wish to import the full XMLSchema
+     schema.  Since derivation is not symmetric, unexpected results may
+     follow from mixing references to these definitions with references
+     to the definitions in the XMLSchema namespace.  For example,
+     although dt:positiveInteger is derived from xs:integer, the converse
+     does not hold.</documentation>
+  </annotation>
+
+  <simpleType name="string">
+   <restriction base="string"/>
+  </simpleType>
+  <simpleType name="boolean">
+   <restriction base="boolean"/>
+  </simpleType>
+  <simpleType name="float">
+   <restriction base="float"/>
+  </simpleType>
+  <simpleType name="double">
+   <restriction base="double"/>
+  </simpleType>
+  <simpleType name="decimal">
+   <restriction base="decimal"/>
+  </simpleType>
+  <simpleType name="dateTime">
+   <restriction base="dateTime"/>
+  </simpleType>
+  <simpleType name="duration">
+   <restriction base="duration"/>
+  </simpleType>
+  <simpleType name="hexBinary">
+   <restriction base="hexBinary"/>
+  </simpleType>
+  <simpleType name="base64Binary">
+   <restriction base="base64Binary"/>
+  </simpleType>
+  <simpleType name="anyURI">
+   <restriction base="anyURI"/>
+  </simpleType>
+  <simpleType name="ID">
+   <restriction base="ID"/>
+  </simpleType>
+  <simpleType name="IDREF">
+   <restriction base="IDREF"/>
+  </simpleType>
+  <simpleType name="ENTITY">
+   <restriction base="ENTITY"/>
+  </simpleType>
+  <simpleType name="NOTATION">
+   <restriction base="NOTATION"/>
+  </simpleType>
+  <simpleType name="normalizedString">
+   <restriction base="normalizedString"/>
+  </simpleType>
+  <simpleType name="token">
+   <restriction base="token"/>
+  </simpleType>
+  <simpleType name="language">
+   <restriction base="language"/>
+  </simpleType>
+  <simpleType name="IDREFS">
+   <restriction base="IDREFS"/>
+  </simpleType>
+  <simpleType name="ENTITIES">
+   <restriction base="ENTITIES"/>
+  </simpleType>
+  <simpleType name="NMTOKEN">
+   <restriction base="NMTOKEN"/>
+  </simpleType>
+  <simpleType name="NMTOKENS">
+   <restriction base="NMTOKENS"/>
+  </simpleType>
+  <simpleType name="Name">
+   <restriction base="Name"/>
+  </simpleType>
+  <simpleType name="QName">
+   <restriction base="QName"/>
+  </simpleType>
+  <simpleType name="NCName">
+   <restriction base="NCName"/>
+  </simpleType>
+  <simpleType name="integer">
+   <restriction base="integer"/>
+  </simpleType>
+  <simpleType name="nonNegativeInteger">
+   <restriction base="nonNegativeInteger"/>
+  </simpleType>
+  <simpleType name="positiveInteger">
+   <restriction base="positiveInteger"/>
+  </simpleType>
+  <simpleType name="nonPositiveInteger">
+   <restriction base="nonPositiveInteger"/>
+  </simpleType>
+  <simpleType name="negativeInteger">
+   <restriction base="negativeInteger"/>
+  </simpleType>
+  <simpleType name="byte">
+   <restriction base="byte"/>
+  </simpleType>
+  <simpleType name="int">
+   <restriction base="int"/>
+  </simpleType>
+  <simpleType name="long">
+   <restriction base="long"/>
+  </simpleType>
+  <simpleType name="short">
+   <restriction base="short"/>
+  </simpleType>
+  <simpleType name="unsignedByte">
+   <restriction base="unsignedByte"/>
+  </simpleType>
+  <simpleType name="unsignedInt">
+   <restriction base="unsignedInt"/>
+  </simpleType>
+  <simpleType name="unsignedLong">
+   <restriction base="unsignedLong"/>
+  </simpleType>
+  <simpleType name="unsignedShort">
+   <restriction base="unsignedShort"/>
+  </simpleType>
+  <simpleType name="date">
+   <restriction base="date"/>
+  </simpleType>
+  <simpleType name="time">
+   <restriction base="time"/>
+  </simpleType>
+  <simpleType name="gYearMonth">
+   <restriction base="gYearMonth"/>
+  </simpleType>
+  <simpleType name="gYear">
+   <restriction base="gYear"/>
+  </simpleType>
+  <simpleType name="gMonthDay">
+   <restriction base="gMonthDay"/>
+  </simpleType>
+  <simpleType name="gDay">
+   <restriction base="gDay"/>
+  </simpleType>
+  <simpleType name="gMonth">
+   <restriction base="gMonth"/>
+  </simpleType>
+
+</schema>
diff --git a/SDT/schema4.0/etc/XMLSchema.dtd b/SDT/schema4.0/etc/XMLSchema.dtd
new file mode 100644
index 0000000000000000000000000000000000000000..e8e8f7625a994596f8ade6565b9711398fb502b5
--- /dev/null
+++ b/SDT/schema4.0/etc/XMLSchema.dtd
@@ -0,0 +1,402 @@
+<!-- DTD for XML Schemas: Part 1: Structures
+     Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN"
+     Official Location: http://www.w3.org/2001/XMLSchema.dtd -->
+<!-- $Id: XMLSchema.dtd,v 1.31 2001/10/24 15:50:16 ht Exp $ -->
+<!-- Note this DTD is NOT normative, or even definitive. -->           <!--d-->
+<!-- prose copy in the structures REC is the definitive version -->    <!--d-->
+<!-- (which shouldn't differ from this one except for this -->         <!--d-->
+<!-- comment and entity expansions, but just in case) -->              <!--d-->
+<!-- With the exception of cases with multiple namespace
+     prefixes for the XML Schema namespace, any XML document which is
+     not valid per this DTD given redefinitions in its internal subset of the
+     'p' and 's' parameter entities below appropriate to its namespace
+     declaration of the XML Schema namespace is almost certainly not
+     a valid schema. -->
+
+<!-- The simpleType element and its constituent parts
+     are defined in XML Schema: Part 2: Datatypes -->
+<!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >
+
+<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a
+                         schema document to establish a different
+                         namespace prefix -->
+<!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must
+                         also define %s as the suffix for the appropriate
+                         namespace declaration (e.g. :foo) -->
+<!ENTITY % nds 'xmlns%s;'>
+
+<!-- Define all the element names, with optional prefix -->
+<!ENTITY % schema "%p;schema">
+<!ENTITY % complexType "%p;complexType">
+<!ENTITY % complexContent "%p;complexContent">
+<!ENTITY % simpleContent "%p;simpleContent">
+<!ENTITY % extension "%p;extension">
+<!ENTITY % element "%p;element">
+<!ENTITY % unique "%p;unique">
+<!ENTITY % key "%p;key">
+<!ENTITY % keyref "%p;keyref">
+<!ENTITY % selector "%p;selector">
+<!ENTITY % field "%p;field">
+<!ENTITY % group "%p;group">
+<!ENTITY % all "%p;all">
+<!ENTITY % choice "%p;choice">
+<!ENTITY % sequence "%p;sequence">
+<!ENTITY % any "%p;any">
+<!ENTITY % anyAttribute "%p;anyAttribute">
+<!ENTITY % attribute "%p;attribute">
+<!ENTITY % attributeGroup "%p;attributeGroup">
+<!ENTITY % include "%p;include">
+<!ENTITY % import "%p;import">
+<!ENTITY % redefine "%p;redefine">
+<!ENTITY % notation "%p;notation">
+
+<!-- annotation elements -->
+<!ENTITY % annotation "%p;annotation">
+<!ENTITY % appinfo "%p;appinfo">
+<!ENTITY % documentation "%p;documentation">
+
+<!-- Customisation entities for the ATTLIST of each element type.
+     Define one of these if your schema takes advantage of the
+     anyAttribute='##other' in the schema for schemas -->
+
+<!ENTITY % schemaAttrs ''>
+<!ENTITY % complexTypeAttrs ''>
+<!ENTITY % complexContentAttrs ''>
+<!ENTITY % simpleContentAttrs ''>
+<!ENTITY % extensionAttrs ''>
+<!ENTITY % elementAttrs ''>
+<!ENTITY % groupAttrs ''>
+<!ENTITY % allAttrs ''>
+<!ENTITY % choiceAttrs ''>
+<!ENTITY % sequenceAttrs ''>
+<!ENTITY % anyAttrs ''>
+<!ENTITY % anyAttributeAttrs ''>
+<!ENTITY % attributeAttrs ''>
+<!ENTITY % attributeGroupAttrs ''>
+<!ENTITY % uniqueAttrs ''>
+<!ENTITY % keyAttrs ''>
+<!ENTITY % keyrefAttrs ''>
+<!ENTITY % selectorAttrs ''>
+<!ENTITY % fieldAttrs ''>
+<!ENTITY % includeAttrs ''>
+<!ENTITY % importAttrs ''>
+<!ENTITY % redefineAttrs ''>
+<!ENTITY % notationAttrs ''>
+<!ENTITY % annotationAttrs ''>
+<!ENTITY % appinfoAttrs ''>
+<!ENTITY % documentationAttrs ''>
+
+<!ENTITY % complexDerivationSet "CDATA">
+      <!-- #all or space-separated list drawn from derivationChoice -->
+<!ENTITY % blockSet "CDATA">
+      <!-- #all or space-separated list drawn from
+                      derivationChoice + 'substitution' -->
+
+<!ENTITY % mgs '%all; | %choice; | %sequence;'>
+<!ENTITY % cs '%choice; | %sequence;'>
+<!ENTITY % formValues '(qualified|unqualified)'>
+
+
+<!ENTITY % attrDecls    '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>
+
+<!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>
+
+<!-- This is used in part2 -->
+<!ENTITY % restriction1 '((%mgs; | %group;)?)'>
+
+%xs-datatypes;
+
+<!-- the duplication below is to produce an unambiguous content model
+     which allows annotation everywhere -->
+<!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,
+                    ((%simpleType; | %complexType;
+                      | %element; | %attribute;
+                      | %attributeGroup; | %group;
+                      | %notation; ),
+                     (%annotation;)*)* )>
+<!ATTLIST %schema;
+   targetNamespace      %URIref;               #IMPLIED
+   version              CDATA                  #IMPLIED
+   %nds;                %URIref;               #FIXED 'http://www.w3.org/2001/XMLSchema'
+   xmlns                CDATA                  #IMPLIED
+   finalDefault         %complexDerivationSet; ''
+   blockDefault         %blockSet;             ''
+   id                   ID                     #IMPLIED
+   elementFormDefault   %formValues;           'unqualified'
+   attributeFormDefault %formValues;           'unqualified'
+   xml:lang             CDATA                  #IMPLIED
+   %schemaAttrs;>
+<!-- Note the xmlns declaration is NOT in the Schema for Schemas,
+     because at the Infoset level where schemas operate,
+     xmlns(:prefix) is NOT an attribute! -->
+<!-- The declaration of xmlns is a convenience for schema authors -->
+ 
+<!-- The id attribute here and below is for use in external references
+     from non-schemas using simple fragment identifiers.
+     It is NOT used for schema-to-schema reference, internal or
+     external. -->
+
+<!-- a type is a named content type specification which allows attribute
+     declarations-->
+<!-- -->
+
+<!ELEMENT %complexType; ((%annotation;)?,
+                         (%simpleContent;|%complexContent;|
+                          %particleAndAttrs;))>
+
+<!ATTLIST %complexType;
+          name      %NCName;                        #IMPLIED
+          id        ID                              #IMPLIED
+          abstract  %boolean;                       #IMPLIED
+          final     %complexDerivationSet;          #IMPLIED
+          block     %complexDerivationSet;          #IMPLIED
+          mixed (true|false) 'false'
+          %complexTypeAttrs;>
+
+<!-- particleAndAttrs is shorthand for a root type -->
+<!-- mixed is disallowed if simpleContent, overriden if complexContent
+     has one too. -->
+
+<!-- If anyAttribute appears in one or more referenced attributeGroups
+     and/or explicitly, the intersection of the permissions is used -->
+
+<!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %complexContent;
+          mixed (true|false) #IMPLIED
+          id    ID           #IMPLIED
+          %complexContentAttrs;>
+
+<!-- restriction should use the branch defined above, not the simple
+     one from part2; extension should use the full model  -->
+
+<!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %simpleContent;
+          id    ID           #IMPLIED
+          %simpleContentAttrs;>
+
+<!-- restriction should use the simple branch from part2, not the 
+     one defined above; extension should have no particle  -->
+
+<!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))>
+<!ATTLIST %extension;
+          base  %QName;      #REQUIRED
+          id    ID           #IMPLIED
+          %extensionAttrs;>
+
+<!-- an element is declared by either:
+ a name and a type (either nested or referenced via the type attribute)
+ or a ref to an existing element declaration -->
+
+<!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
+                     (%unique; | %key; | %keyref;)*)>
+<!-- simpleType or complexType only if no type|ref attribute -->
+<!-- ref not allowed at top level -->
+<!ATTLIST %element;
+            name               %NCName;               #IMPLIED
+            id                 ID                     #IMPLIED
+            ref                %QName;                #IMPLIED
+            type               %QName;                #IMPLIED
+            minOccurs          %nonNegativeInteger;   #IMPLIED
+            maxOccurs          CDATA                  #IMPLIED
+            nillable           %boolean;              #IMPLIED
+            substitutionGroup  %QName;                #IMPLIED
+            abstract           %boolean;              #IMPLIED
+            final              %complexDerivationSet; #IMPLIED
+            block              %blockSet;             #IMPLIED
+            default            CDATA                  #IMPLIED
+            fixed              CDATA                  #IMPLIED
+            form               %formValues;           #IMPLIED
+            %elementAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- In the absence of type AND ref, type defaults to type of
+     substitutionGroup, if any, else the ur-type, i.e. unconstrained -->
+<!-- default and fixed are mutually exclusive -->
+
+<!ELEMENT %group; ((%annotation;)?,(%mgs;)?)>
+<!ATTLIST %group; 
+          name        %NCName;               #IMPLIED
+          ref         %QName;                #IMPLIED
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %groupAttrs;>
+
+<!ELEMENT %all; ((%annotation;)?, (%element;)*)>
+<!ATTLIST %all;
+          minOccurs   (1)                    #IMPLIED
+          maxOccurs   (1)                    #IMPLIED
+          id          ID                     #IMPLIED
+          %allAttrs;>
+
+<!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %choice;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %choiceAttrs;>
+
+<!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %sequence;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %sequenceAttrs;>
+
+<!-- an anonymous grouping in a model, or
+     a top-level named group definition, or a reference to same -->
+
+<!-- Note that if order is 'all', group is not allowed inside.
+     If order is 'all' THIS group must be alone (or referenced alone) at
+     the top level of a content model -->
+<!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
+<!-- Should allow minOccurs=0 inside order='all' . . . -->
+
+<!ELEMENT %any; (%annotation;)?>
+<!ATTLIST %any;
+            namespace       CDATA                  '##any'
+            processContents (skip|lax|strict)      'strict'
+            minOccurs       %nonNegativeInteger;   '1'
+            maxOccurs       CDATA                  '1'
+            id              ID                     #IMPLIED
+            %anyAttrs;>
+
+<!-- namespace is interpreted as follows:
+                  ##any      - - any non-conflicting WFXML at all
+
+                  ##other    - - any non-conflicting WFXML from namespace other
+                                  than targetNamespace
+
+                  ##local    - - any unqualified non-conflicting WFXML/attribute
+                  one or     - - any non-conflicting WFXML from
+                  more URI        the listed namespaces
+                  references
+
+                  ##targetNamespace ##local may appear in the above list,
+                    with the obvious meaning -->
+
+<!ELEMENT %anyAttribute; (%annotation;)?>
+<!ATTLIST %anyAttribute;
+            namespace       CDATA              '##any'
+            processContents (skip|lax|strict)  'strict'
+            id              ID                 #IMPLIED
+            %anyAttributeAttrs;>
+<!-- namespace is interpreted as for 'any' above -->
+
+<!-- simpleType only if no type|ref attribute -->
+<!-- ref not allowed at top level, name iff at top level -->
+<!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
+<!ATTLIST %attribute;
+          name      %NCName;      #IMPLIED
+          id        ID            #IMPLIED
+          ref       %QName;       #IMPLIED
+          type      %QName;       #IMPLIED
+          use       (prohibited|optional|required) #IMPLIED
+          default   CDATA         #IMPLIED
+          fixed     CDATA         #IMPLIED
+          form      %formValues;  #IMPLIED
+          %attributeAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- default for use is optional when nested, none otherwise -->
+<!-- default and fixed are mutually exclusive -->
+<!-- type attr and simpleType content are mutually exclusive -->
+
+<!-- an attributeGroup is a named collection of attribute decls, or a
+     reference thereto -->
+<!ELEMENT %attributeGroup; ((%annotation;)?,
+                       (%attribute; | %attributeGroup;)*,
+                       (%anyAttribute;)?) >
+<!ATTLIST %attributeGroup;
+                 name       %NCName;       #IMPLIED
+                 id         ID             #IMPLIED
+                 ref        %QName;        #IMPLIED
+                 %attributeGroupAttrs;>
+
+<!-- ref iff no content, no name.  ref iff not top level -->
+
+<!-- better reference mechanisms -->
+<!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %unique;
+          name     %NCName;       #REQUIRED
+	  id       ID             #IMPLIED
+	  %uniqueAttrs;>
+
+<!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %key;
+          name     %NCName;       #REQUIRED
+	  id       ID             #IMPLIED
+	  %keyAttrs;>
+
+<!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %keyref;
+          name     %NCName;       #REQUIRED
+	  refer    %QName;        #REQUIRED
+	  id       ID             #IMPLIED
+	  %keyrefAttrs;>
+
+<!ELEMENT %selector; ((%annotation;)?)>
+<!ATTLIST %selector;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %selectorAttrs;>
+<!ELEMENT %field; ((%annotation;)?)>
+<!ATTLIST %field;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %fieldAttrs;>
+
+<!-- Schema combination mechanisms -->
+<!ELEMENT %include; (%annotation;)?>
+<!ATTLIST %include;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %includeAttrs;>
+
+<!ELEMENT %import; (%annotation;)?>
+<!ATTLIST %import;
+          namespace      %URIref; #IMPLIED
+          schemaLocation %URIref; #IMPLIED
+          id             ID       #IMPLIED
+          %importAttrs;>
+
+<!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |
+                      %attributeGroup; | %group;)*>
+<!ATTLIST %redefine;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %redefineAttrs;>
+
+<!ELEMENT %notation; (%annotation;)?>
+<!ATTLIST %notation;
+	  name        %NCName;    #REQUIRED
+	  id          ID          #IMPLIED
+	  public      CDATA       #REQUIRED
+	  system      %URIref;    #IMPLIED
+	  %notationAttrs;>
+
+<!-- Annotation is either application information or documentation -->
+<!-- By having these here they are available for datatypes as well
+     as all the structures elements -->
+
+<!ELEMENT %annotation; (%appinfo; | %documentation;)*>
+<!ATTLIST %annotation; %annotationAttrs;>
+
+<!-- User must define annotation elements in internal subset for this
+     to work -->
+<!ELEMENT %appinfo; ANY>   <!-- too restrictive -->
+<!ATTLIST %appinfo;
+          source     %URIref;      #IMPLIED
+          id         ID         #IMPLIED
+          %appinfoAttrs;>
+<!ELEMENT %documentation; ANY>   <!-- too restrictive -->
+<!ATTLIST %documentation;
+          source     %URIref;   #IMPLIED
+          id         ID         #IMPLIED
+          xml:lang   CDATA      #IMPLIED
+          %documentationAttrs;>
+
+<!NOTATION XMLSchemaStructures PUBLIC
+           'structures' 'http://www.w3.org/2001/XMLSchema.xsd' >
+<!NOTATION XML PUBLIC
+           'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >
diff --git a/SDT/schema4.0/etc/XMLSchema.xsd b/SDT/schema4.0/etc/XMLSchema.xsd
new file mode 100644
index 0000000000000000000000000000000000000000..2e9a2729ec5dcf3cba092c68cbe82de0d4527903
--- /dev/null
+++ b/SDT/schema4.0/etc/XMLSchema.xsd
@@ -0,0 +1,2534 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- XML Schema schema for XML Schemas: Part 1: Structures -->
+<!-- Note this schema is NOT the normative structures schema. -->
+<!-- The prose copy in the structures REC is the normative -->
+<!-- version (which shouldn't differ from this one except for -->
+<!-- this comment and entity expansions, but just in case -->
+<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [
+
+<!-- provide ID type information even for parsers which only read the
+     internal subset -->
+<!ATTLIST xs:schema          id  ID  #IMPLIED>
+<!ATTLIST xs:complexType     id  ID  #IMPLIED>
+<!ATTLIST xs:complexContent  id  ID  #IMPLIED>
+<!ATTLIST xs:simpleContent   id  ID  #IMPLIED>
+<!ATTLIST xs:extension       id  ID  #IMPLIED>
+<!ATTLIST xs:element         id  ID  #IMPLIED>
+<!ATTLIST xs:group           id  ID  #IMPLIED> 
+<!ATTLIST xs:all             id  ID  #IMPLIED>
+<!ATTLIST xs:choice          id  ID  #IMPLIED>
+<!ATTLIST xs:sequence        id  ID  #IMPLIED>
+<!ATTLIST xs:any             id  ID  #IMPLIED>
+<!ATTLIST xs:anyAttribute    id  ID  #IMPLIED>
+<!ATTLIST xs:attribute       id  ID  #IMPLIED>
+<!ATTLIST xs:attributeGroup  id  ID  #IMPLIED>
+<!ATTLIST xs:unique          id  ID  #IMPLIED>
+<!ATTLIST xs:key             id  ID  #IMPLIED>
+<!ATTLIST xs:keyref          id  ID  #IMPLIED>
+<!ATTLIST xs:selector        id  ID  #IMPLIED>
+<!ATTLIST xs:field           id  ID  #IMPLIED>
+<!ATTLIST xs:include         id  ID  #IMPLIED>
+<!ATTLIST xs:import          id  ID  #IMPLIED>
+<!ATTLIST xs:redefine        id  ID  #IMPLIED>
+<!ATTLIST xs:notation        id  ID  #IMPLIED>
+<!--
+     keep this schema XML1.0 DTD valid
+  -->
+        <!ENTITY % schemaAttrs 'xmlns:hfp CDATA #IMPLIED'>
+
+        <!ELEMENT hfp:hasFacet EMPTY>
+        <!ATTLIST hfp:hasFacet
+                name NMTOKEN #REQUIRED>
+
+        <!ELEMENT hfp:hasProperty EMPTY>
+        <!ATTLIST hfp:hasProperty
+                name NMTOKEN #REQUIRED
+                value CDATA #REQUIRED>
+<!--
+        Make sure that processors that do not read the external
+        subset will know about the various IDs we declare
+  -->
+        <!ATTLIST xs:simpleType id ID #IMPLIED>
+        <!ATTLIST xs:maxExclusive id ID #IMPLIED>
+        <!ATTLIST xs:minExclusive id ID #IMPLIED>
+        <!ATTLIST xs:maxInclusive id ID #IMPLIED>
+        <!ATTLIST xs:minInclusive id ID #IMPLIED>
+        <!ATTLIST xs:totalDigits id ID #IMPLIED>
+        <!ATTLIST xs:fractionDigits id ID #IMPLIED>
+        <!ATTLIST xs:length id ID #IMPLIED>
+        <!ATTLIST xs:minLength id ID #IMPLIED>
+        <!ATTLIST xs:maxLength id ID #IMPLIED>
+        <!ATTLIST xs:enumeration id ID #IMPLIED>
+        <!ATTLIST xs:pattern id ID #IMPLIED>
+        <!ATTLIST xs:appinfo id ID #IMPLIED>
+        <!ATTLIST xs:documentation id ID #IMPLIED>
+        <!ATTLIST xs:list id ID #IMPLIED>
+        <!ATTLIST xs:union id ID #IMPLIED>
+        ]>
+<xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema" blockDefault="#all" elementFormDefault="qualified" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="EN" xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty">
+ <xs:annotation>
+  <xs:documentation>
+    Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp 
+    Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp 
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/structures.html">
+   The schema corresponding to this document is normative,
+   with respect to the syntactic constraints it expresses in the
+   XML Schema language.  The documentation (within &lt;documentation> elements)
+   below, is not normative, but rather highlights important aspects of
+   the W3C Recommendation of which this is a part</xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+   <xs:documentation>
+   The simpleType element and all of its members are defined
+      towards the end of this schema document</xs:documentation>
+ </xs:annotation>
+
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd">
+   <xs:annotation>
+     <xs:documentation>
+       Get access to the xml: attribute groups for xml:lang
+       as declared on 'schema' and 'documentation' below
+     </xs:documentation>
+   </xs:annotation>
+ </xs:import>
+
+ <xs:complexType name="openAttrs">
+   <xs:annotation>
+     <xs:documentation>
+       This type is extended by almost all schema types
+       to allow attributes from other namespaces to be
+       added to user schemas.
+     </xs:documentation>
+   </xs:annotation>
+   <xs:complexContent>
+     <xs:restriction base="xs:anyType">
+       <xs:anyAttribute namespace="##other" processContents="lax"/>
+     </xs:restriction>
+   </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="annotated">
+   <xs:annotation>
+     <xs:documentation>
+       This type is extended by all types which allow annotation
+       other than &lt;schema&gt; itself
+     </xs:documentation>
+   </xs:annotation>
+   <xs:complexContent>
+     <xs:extension base="xs:openAttrs">
+       <xs:sequence>
+         <xs:element ref="xs:annotation" minOccurs="0"/>
+       </xs:sequence>
+       <xs:attribute name="id" type="xs:ID"/>
+     </xs:extension>
+   </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="schemaTop">
+  <xs:annotation>
+   <xs:documentation>
+   This group is for the
+   elements which occur freely at the top level of schemas.
+   All of their types are based on the "annotated" type by extension.</xs:documentation>
+  </xs:annotation>
+  <xs:choice>
+   <xs:group ref="xs:redefinable"/>
+   <xs:element ref="xs:element"/>
+   <xs:element ref="xs:attribute"/>
+   <xs:element ref="xs:notation"/>
+  </xs:choice>
+ </xs:group>
+ 
+ <xs:group name="redefinable">
+  <xs:annotation>
+   <xs:documentation>
+   This group is for the
+   elements which can self-redefine (see &lt;redefine> below).</xs:documentation>
+  </xs:annotation>
+  <xs:choice>
+   <xs:element ref="xs:simpleType"/>
+   <xs:element ref="xs:complexType"/>
+   <xs:element ref="xs:group"/>
+   <xs:element ref="xs:attributeGroup"/>
+  </xs:choice>
+ </xs:group>
+
+ <xs:simpleType name="formChoice">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:NMTOKEN">
+   <xs:enumeration value="qualified"/>
+   <xs:enumeration value="unqualified"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="reducedDerivationControl">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:derivationControl">
+   <xs:enumeration value="extension"/>
+   <xs:enumeration value="restriction"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="derivationSet">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+   <xs:documentation>
+   #all or (possibly empty) subset of {extension, restriction}</xs:documentation>
+  </xs:annotation>
+  <xs:union>
+   <xs:simpleType>    
+    <xs:restriction base="xs:token">
+     <xs:enumeration value="#all"/>
+    </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType>
+    <xs:list itemType="xs:reducedDerivationControl"/>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+ <xs:simpleType name="typeDerivationControl">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:derivationControl">
+   <xs:enumeration value="extension"/>
+   <xs:enumeration value="restriction"/>
+   <xs:enumeration value="list"/>
+   <xs:enumeration value="union"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+  <xs:simpleType name="fullDerivationSet">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+   <xs:documentation>
+   #all or (possibly empty) subset of {extension, restriction, list, union}</xs:documentation>
+  </xs:annotation>
+  <xs:union>
+   <xs:simpleType>    
+    <xs:restriction base="xs:token">
+     <xs:enumeration value="#all"/>
+    </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType>
+    <xs:list itemType="xs:typeDerivationControl"/>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+ <xs:element name="schema" id="schema">
+  <xs:annotation>
+    <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-schema"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:openAttrs">
+     <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+       <xs:element ref="xs:include"/>
+       <xs:element ref="xs:import"/>
+       <xs:element ref="xs:redefine"/>
+       <xs:element ref="xs:annotation"/>
+      </xs:choice>
+      <xs:sequence minOccurs="0" maxOccurs="unbounded">
+       <xs:group ref="xs:schemaTop"/>
+       <xs:element ref="xs:annotation" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+     </xs:sequence>
+     <xs:attribute name="targetNamespace" type="xs:anyURI"/>
+     <xs:attribute name="version" type="xs:token"/>
+     <xs:attribute name="finalDefault" type="xs:fullDerivationSet" use="optional" default=""/>
+     <xs:attribute name="blockDefault" type="xs:blockSet" use="optional" default=""/>
+     <xs:attribute name="attributeFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
+     <xs:attribute name="elementFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
+     <xs:attribute name="id" type="xs:ID"/>
+     <xs:attribute ref="xml:lang"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+
+  <xs:key name="element">
+   <xs:selector xpath="xs:element"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+
+  <xs:key name="attribute">
+   <xs:selector xpath="xs:attribute"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+
+  <xs:key name="type">
+   <xs:selector xpath="xs:complexType|xs:simpleType"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+ 
+  <xs:key name="group">
+   <xs:selector xpath="xs:group"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+ 
+  <xs:key name="attributeGroup">
+   <xs:selector xpath="xs:attributeGroup"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+ 
+  <xs:key name="notation">
+   <xs:selector xpath="xs:notation"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+
+  <xs:key name="identityConstraint">
+   <xs:selector xpath=".//xs:key|.//xs:unique|.//xs:keyref"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+
+ </xs:element>
+
+ <xs:simpleType name="allNNI">
+  <xs:annotation><xs:documentation>
+   for maxOccurs</xs:documentation></xs:annotation>
+  <xs:union memberTypes="xs:nonNegativeInteger">
+   <xs:simpleType>
+    <xs:restriction base="xs:NMTOKEN">
+     <xs:enumeration value="unbounded"/>
+    </xs:restriction>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+ <xs:attributeGroup name="occurs">
+  <xs:annotation><xs:documentation>
+   for all particles</xs:documentation></xs:annotation>
+  <xs:attribute name="minOccurs" type="xs:nonNegativeInteger" use="optional" default="1"/>
+  <xs:attribute name="maxOccurs" type="xs:allNNI" use="optional" default="1"/>
+ </xs:attributeGroup>
+
+ <xs:attributeGroup name="defRef">
+  <xs:annotation><xs:documentation>
+   for element, group and attributeGroup,
+   which both define and reference</xs:documentation></xs:annotation>
+  <xs:attribute name="name" type="xs:NCName"/>
+  <xs:attribute name="ref" type="xs:QName"/>
+ </xs:attributeGroup>
+
+ <xs:group name="typeDefParticle">
+  <xs:annotation>
+    <xs:documentation>
+   'complexType' uses this</xs:documentation></xs:annotation>
+  <xs:choice>
+   <xs:element name="group" type="xs:groupRef"/>
+   <xs:element ref="xs:all"/>
+   <xs:element ref="xs:choice"/>
+   <xs:element ref="xs:sequence"/>
+  </xs:choice>
+ </xs:group>
+ 
+ 
+
+ <xs:group name="nestedParticle">
+  <xs:choice>
+   <xs:element name="element" type="xs:localElement"/>
+   <xs:element name="group" type="xs:groupRef"/>
+   <xs:element ref="xs:choice"/>
+   <xs:element ref="xs:sequence"/>
+   <xs:element ref="xs:any"/>
+  </xs:choice>
+ </xs:group>
+ 
+ <xs:group name="particle">
+  <xs:choice>
+   <xs:element name="element" type="xs:localElement"/>
+   <xs:element name="group" type="xs:groupRef"/>
+   <xs:element ref="xs:all"/>
+   <xs:element ref="xs:choice"/>
+   <xs:element ref="xs:sequence"/>
+   <xs:element ref="xs:any"/>
+  </xs:choice>
+ </xs:group>
+ 
+ <xs:complexType name="attribute">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/>
+    </xs:sequence>
+    <xs:attributeGroup ref="xs:defRef"/>
+    <xs:attribute name="type" type="xs:QName"/>
+    <xs:attribute name="use" use="optional" default="optional">
+     <xs:simpleType>
+      <xs:restriction base="xs:NMTOKEN">
+       <xs:enumeration value="prohibited"/>
+       <xs:enumeration value="optional"/>
+       <xs:enumeration value="required"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="default" type="xs:string"/>
+    <xs:attribute name="fixed" type="xs:string"/>
+    <xs:attribute name="form" type="xs:formChoice"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:complexType name="topLevelAttribute">
+  <xs:complexContent>
+   <xs:restriction base="xs:attribute">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/>
+    </xs:sequence>
+    <xs:attribute name="ref" use="prohibited"/>
+    <xs:attribute name="form" use="prohibited"/>
+    <xs:attribute name="use" use="prohibited"/>
+    <xs:attribute name="name" use="required" type="xs:NCName"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="attrDecls">
+  <xs:sequence>
+   <xs:choice minOccurs="0" maxOccurs="unbounded">
+    <xs:element name="attribute" type="xs:attribute"/>
+    <xs:element name="attributeGroup" type="xs:attributeGroupRef"/>
+   </xs:choice>
+   <xs:element ref="xs:anyAttribute" minOccurs="0"/>
+  </xs:sequence>
+ </xs:group>
+
+ <xs:element name="anyAttribute" type="xs:wildcard" id="anyAttribute">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:group name="complexTypeModel">
+  <xs:choice>
+      <xs:element ref="xs:simpleContent"/>
+      <xs:element ref="xs:complexContent"/>
+      <xs:sequence>
+       <xs:annotation>
+        <xs:documentation>
+   This branch is short for
+   &lt;complexContent>
+   &lt;restriction base="xs:anyType">
+   ...
+   &lt;/restriction>
+   &lt;/complexContent></xs:documentation>
+       </xs:annotation>
+       <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
+       <xs:group ref="xs:attrDecls"/>
+      </xs:sequence>
+  </xs:choice>
+ </xs:group>
+
+ <xs:complexType name="complexType" abstract="true">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:group ref="xs:complexTypeModel"/>
+    <xs:attribute name="name" type="xs:NCName">
+     <xs:annotation>
+      <xs:documentation>
+      Will be restricted to required or forbidden</xs:documentation>
+     </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mixed" type="xs:boolean" use="optional" default="false">
+     <xs:annotation>
+      <xs:documentation>
+      Not allowed if simpleContent child is chosen.
+      May be overriden by setting on complexContent child.</xs:documentation>
+    </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/>
+    <xs:attribute name="final" type="xs:derivationSet"/>
+    <xs:attribute name="block" type="xs:derivationSet"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:complexType name="topLevelComplexType">
+  <xs:complexContent>
+   <xs:restriction base="xs:complexType">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:complexTypeModel"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:NCName" use="required"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:complexType name="localComplexType">
+  <xs:complexContent>
+   <xs:restriction base="xs:complexType">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:complexTypeModel"/>
+    </xs:sequence>
+    <xs:attribute name="name" use="prohibited"/>
+    <xs:attribute name="abstract" use="prohibited"/>
+    <xs:attribute name="final" use="prohibited"/>
+    <xs:attribute name="block" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:complexType name="restrictionType">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:choice minOccurs="0">
+      <xs:group ref="xs:typeDefParticle"/>
+      <xs:group ref="xs:simpleRestrictionModel"/>
+     </xs:choice>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:attribute name="base" type="xs:QName" use="required"/>
+   </xs:extension>
+  </xs:complexContent>       
+ </xs:complexType>
+
+ <xs:complexType name="complexRestrictionType">
+  <xs:complexContent>
+   <xs:restriction base="xs:restrictionType">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:annotation>
+       <xs:documentation>This choice is added simply to
+                   make this a valid restriction per the REC</xs:documentation>
+      </xs:annotation>
+      <xs:group ref="xs:typeDefParticle"/>
+     </xs:choice>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>       
+ </xs:complexType>
+
+ <xs:complexType name="extensionType">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:attribute name="base" type="xs:QName" use="required"/>
+   </xs:extension>
+  </xs:complexContent>       
+ </xs:complexType>
+
+ <xs:element name="complexContent" id="complexContent">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexContent"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:choice>
+      <xs:element name="restriction" type="xs:complexRestrictionType"/>
+      <xs:element name="extension" type="xs:extensionType"/>
+     </xs:choice>     
+     <xs:attribute name="mixed" type="xs:boolean">
+      <xs:annotation>
+       <xs:documentation>
+       Overrides any setting on complexType parent.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="simpleRestrictionType">
+  <xs:complexContent>
+   <xs:restriction base="xs:restrictionType">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:annotation>
+       <xs:documentation>This choice is added simply to
+                   make this a valid restriction per the REC</xs:documentation>
+      </xs:annotation>
+      <xs:group ref="xs:simpleRestrictionModel"/>
+     </xs:choice>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="simpleExtensionType">
+  <xs:complexContent>
+   <xs:restriction base="xs:extensionType">
+    <xs:sequence>
+     <xs:annotation>
+      <xs:documentation>
+      No typeDefParticle group reference</xs:documentation>
+     </xs:annotation>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="simpleContent" id="simpleContent">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-simpleContent"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:choice>
+      <xs:element name="restriction" type="xs:simpleRestrictionType"/>
+      <xs:element name="extension" type="xs:simpleExtensionType"/>
+     </xs:choice>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+ 
+ <xs:element name="complexType" type="xs:topLevelComplexType" id="complexType">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexType"/>
+  </xs:annotation>
+ </xs:element>
+
+
+  <xs:simpleType name="blockSet">
+   <xs:annotation>
+    <xs:documentation>
+    A utility type, not for public use</xs:documentation>
+    <xs:documentation>
+    #all or (possibly empty) subset of {substitution, extension,
+    restriction}</xs:documentation>
+   </xs:annotation>
+   <xs:union>
+    <xs:simpleType>    
+     <xs:restriction base="xs:token">
+      <xs:enumeration value="#all"/>
+     </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType>
+     <xs:list>
+      <xs:simpleType>
+       <xs:restriction base="xs:derivationControl">
+        <xs:enumeration value="extension"/>
+        <xs:enumeration value="restriction"/>
+        <xs:enumeration value="substitution"/>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:list>
+    </xs:simpleType>
+   </xs:union>  
+  </xs:simpleType>
+
+ <xs:complexType name="element" abstract="true">
+  <xs:annotation>
+   <xs:documentation>
+   The element element can be used either
+   at the top level to define an element-type binding globally,
+   or within a content model to either reference a globally-defined
+   element or type or declare an element-type binding locally.
+   The ref form is not allowed at the top level.</xs:documentation>
+  </xs:annotation>
+
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:choice minOccurs="0">
+      <xs:element name="simpleType" type="xs:localSimpleType"/>
+      <xs:element name="complexType" type="xs:localComplexType"/>
+     </xs:choice>
+     <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attributeGroup ref="xs:defRef"/>
+    <xs:attribute name="type" type="xs:QName"/>
+    <xs:attribute name="substitutionGroup" type="xs:QName"/>
+    <xs:attributeGroup ref="xs:occurs"/>
+    <xs:attribute name="default" type="xs:string"/>
+    <xs:attribute name="fixed" type="xs:string"/>
+    <xs:attribute name="nillable" type="xs:boolean" use="optional" default="false"/>
+    <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/>
+    <xs:attribute name="final" type="xs:derivationSet"/>
+    <xs:attribute name="block" type="xs:blockSet"/>
+    <xs:attribute name="form" type="xs:formChoice"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:complexType name="topLevelElement">
+  <xs:complexContent>
+   <xs:restriction base="xs:element">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:element name="simpleType" type="xs:localSimpleType"/>
+      <xs:element name="complexType" type="xs:localComplexType"/>
+     </xs:choice>
+     <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="ref" use="prohibited"/>
+    <xs:attribute name="form" use="prohibited"/>
+    <xs:attribute name="minOccurs" use="prohibited"/>
+    <xs:attribute name="maxOccurs" use="prohibited"/>
+    <xs:attribute name="name" use="required" type="xs:NCName"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:complexType name="localElement">
+  <xs:complexContent>
+   <xs:restriction base="xs:element">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:element name="simpleType" type="xs:localSimpleType"/>
+      <xs:element name="complexType" type="xs:localComplexType"/>
+     </xs:choice>
+     <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="substitutionGroup" use="prohibited"/>
+    <xs:attribute name="final" use="prohibited"/>
+    <xs:attribute name="abstract" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="element" type="xs:topLevelElement" id="element">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-element"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="group" abstract="true">
+  <xs:annotation>
+   <xs:documentation>
+   group type for explicit groups, named top-level groups and
+   group references</xs:documentation>
+  </xs:annotation>
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:group ref="xs:particle" minOccurs="0" maxOccurs="unbounded"/>
+    <xs:attributeGroup ref="xs:defRef"/>
+    <xs:attributeGroup ref="xs:occurs"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:complexType name="realGroup">
+  <xs:complexContent>
+   <xs:restriction base="xs:group">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0" maxOccurs="1">
+      <xs:element ref="xs:all"/>
+      <xs:element ref="xs:choice"/>
+      <xs:element ref="xs:sequence"/>
+     </xs:choice>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="namedGroup">
+  <xs:complexContent>
+   <xs:restriction base="xs:realGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="1" maxOccurs="1">
+      <xs:element name="all">
+       <xs:complexType>
+        <xs:complexContent>
+         <xs:restriction base="xs:all">
+          <xs:group ref="xs:allModel"/>
+          <xs:attribute name="minOccurs" use="prohibited"/>
+          <xs:attribute name="maxOccurs" use="prohibited"/>
+          <xs:anyAttribute namespace="##other" processContents="lax"/>
+         </xs:restriction>
+        </xs:complexContent>
+       </xs:complexType>
+      </xs:element>
+      <xs:element name="choice" type="xs:simpleExplicitGroup"/>
+      <xs:element name="sequence" type="xs:simpleExplicitGroup"/>
+     </xs:choice>
+    </xs:sequence>
+    <xs:attribute name="name" use="required" type="xs:NCName"/>
+    <xs:attribute name="ref" use="prohibited"/>
+    <xs:attribute name="minOccurs" use="prohibited"/>
+    <xs:attribute name="maxOccurs" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="groupRef">
+  <xs:complexContent>
+   <xs:restriction base="xs:realGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="ref" use="required" type="xs:QName"/>
+    <xs:attribute name="name" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="explicitGroup">
+  <xs:annotation>
+   <xs:documentation>
+   group type for the three kinds of group</xs:documentation>
+  </xs:annotation>
+  <xs:complexContent>
+   <xs:restriction base="xs:group">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:NCName" use="prohibited"/>
+    <xs:attribute name="ref" type="xs:QName" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:complexType name="simpleExplicitGroup">
+  <xs:complexContent>
+   <xs:restriction base="xs:explicitGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="minOccurs" use="prohibited"/>
+    <xs:attribute name="maxOccurs" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:group name="allModel">
+  <xs:sequence>
+      <xs:element ref="xs:annotation" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+       <xs:annotation>
+        <xs:documentation>This choice with min/max is here to
+                          avoid a pblm with the Elt:All/Choice/Seq
+                          Particle derivation constraint</xs:documentation>
+       </xs:annotation>
+       <xs:element name="element" type="xs:narrowMaxMin"/>
+      </xs:choice>
+     </xs:sequence>
+ </xs:group>
+ 
+ 
+ <xs:complexType name="narrowMaxMin">
+  <xs:annotation>
+   <xs:documentation>restricted max/min</xs:documentation>
+  </xs:annotation>
+  <xs:complexContent>
+   <xs:restriction base="xs:localElement">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:element name="simpleType" type="xs:localSimpleType"/>
+      <xs:element name="complexType" type="xs:localComplexType"/>
+     </xs:choice>
+     <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="minOccurs" use="optional" default="1">
+     <xs:simpleType>
+      <xs:restriction base="xs:nonNegativeInteger">
+       <xs:enumeration value="0"/>
+       <xs:enumeration value="1"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="maxOccurs" use="optional" default="1">
+     <xs:simpleType>
+      <xs:restriction base="xs:allNNI">
+       <xs:enumeration value="0"/>
+       <xs:enumeration value="1"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:attribute>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+  <xs:complexType name="all">
+   <xs:annotation>
+    <xs:documentation>
+   Only elements allowed inside</xs:documentation>
+   </xs:annotation>
+   <xs:complexContent>
+    <xs:restriction base="xs:explicitGroup">
+     <xs:group ref="xs:allModel"/>
+     <xs:attribute name="minOccurs" use="optional" default="1">
+      <xs:simpleType>
+       <xs:restriction base="xs:nonNegativeInteger">
+        <xs:enumeration value="0"/>
+        <xs:enumeration value="1"/>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:attribute>
+     <xs:attribute name="maxOccurs" use="optional" default="1">
+      <xs:simpleType>
+       <xs:restriction base="xs:allNNI">
+        <xs:enumeration value="1"/>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:attribute>
+     <xs:anyAttribute namespace="##other" processContents="lax"/>
+    </xs:restriction>
+   </xs:complexContent>
+  </xs:complexType>
+
+ <xs:element name="all" id="all" type="xs:all">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-all"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:element name="choice" type="xs:explicitGroup" id="choice">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-choice"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:element name="sequence" type="xs:explicitGroup" id="sequence">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-sequence"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:element name="group" type="xs:namedGroup" id="group">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-group"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="wildcard">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:attribute name="namespace" type="xs:namespaceList" use="optional" default="##any"/>
+    <xs:attribute name="processContents" use="optional" default="strict">
+     <xs:simpleType>
+      <xs:restriction base="xs:NMTOKEN">
+       <xs:enumeration value="skip"/>
+       <xs:enumeration value="lax"/>
+       <xs:enumeration value="strict"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:attribute>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="any" id="any">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-any"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:wildcard">
+     <xs:attributeGroup ref="xs:occurs"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+  <xs:annotation>
+   <xs:documentation>
+   simple type for the value of the 'namespace' attr of
+   'any' and 'anyAttribute'</xs:documentation>
+  </xs:annotation>
+  <xs:annotation>
+   <xs:documentation>
+   Value is
+              ##any      - - any non-conflicting WFXML/attribute at all
+
+              ##other    - - any non-conflicting WFXML/attribute from
+                              namespace other than targetNS
+
+              ##local    - - any unqualified non-conflicting WFXML/attribute 
+
+              one or     - - any non-conflicting WFXML/attribute from
+              more URI        the listed namespaces
+              references
+              (space separated)
+
+    ##targetNamespace or ##local may appear in the above list, to
+        refer to the targetNamespace of the enclosing
+        schema or an absent targetNamespace respectively</xs:documentation>
+  </xs:annotation>
+
+ <xs:simpleType name="namespaceList">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:union>
+   <xs:simpleType>
+    <xs:restriction base="xs:token">
+     <xs:enumeration value="##any"/>
+     <xs:enumeration value="##other"/>
+    </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType>
+    <xs:list>
+     <xs:simpleType>
+      <xs:union memberTypes="xs:anyURI">
+       <xs:simpleType>
+        <xs:restriction base="xs:token">
+         <xs:enumeration value="##targetNamespace"/>
+         <xs:enumeration value="##local"/>
+        </xs:restriction>
+       </xs:simpleType>
+      </xs:union>
+     </xs:simpleType>
+    </xs:list>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+ <xs:element name="attribute" type="xs:topLevelAttribute" id="attribute">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attribute"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="attributeGroup" abstract="true">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:group ref="xs:attrDecls"/>
+    <xs:attributeGroup ref="xs:defRef"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ 
+ <xs:complexType name="namedAttributeGroup">
+  <xs:complexContent>
+   <xs:restriction base="xs:attributeGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:attribute name="name" use="required" type="xs:NCName"/>
+    <xs:attribute name="ref" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="attributeGroupRef">
+  <xs:complexContent>
+   <xs:restriction base="xs:attributeGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="ref" use="required" type="xs:QName"/>
+    <xs:attribute name="name" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="attributeGroup" type="xs:namedAttributeGroup" id="attributeGroup">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:element name="include" id="include">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-include"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="redefine" id="redefine">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-redefine"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:openAttrs">
+     <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="xs:annotation"/>
+      <xs:group ref="xs:redefinable"/>
+     </xs:choice>
+     <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
+     <xs:attribute name="id" type="xs:ID"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="import" id="import">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-import"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:attribute name="namespace" type="xs:anyURI"/>
+     <xs:attribute name="schemaLocation" type="xs:anyURI"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="selector" id="selector">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-selector"/>
+  </xs:annotation>
+  <xs:complexType>
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+     <xs:attribute name="xpath" use="required">
+      <xs:simpleType>
+       <xs:annotation>
+        <xs:documentation>A subset of XPath expressions for use
+in selectors</xs:documentation>
+        <xs:documentation>A utility type, not for public
+use</xs:documentation>
+       </xs:annotation>
+       <xs:restriction base="xs:token">
+        <xs:annotation>
+         <xs:documentation>The following pattern is intended to allow XPath
+                           expressions per the following EBNF:
+          Selector    ::=    Path ( '|' Path )*  
+          Path    ::=    ('.//')? Step ( '/' Step )*  
+          Step    ::=    '.' | NameTest  
+          NameTest    ::=    QName | '*' | NCName ':' '*'  
+                           child:: is also allowed
+         </xs:documentation>
+        </xs:annotation>
+        <xs:pattern value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*">
+        </xs:pattern>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:attribute>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="field" id="field">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-field"/>
+  </xs:annotation>
+  <xs:complexType>
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+     <xs:attribute name="xpath" use="required">
+      <xs:simpleType>
+       <xs:annotation>
+        <xs:documentation>A subset of XPath expressions for use
+in fields</xs:documentation>
+        <xs:documentation>A utility type, not for public
+use</xs:documentation>
+       </xs:annotation>
+       <xs:restriction base="xs:token">
+        <xs:annotation>
+         <xs:documentation>The following pattern is intended to allow XPath
+                           expressions per the same EBNF as for selector,
+                           with the following change:
+          Path    ::=    ('.//')? ( Step '/' )* ( Step | '@' NameTest ) 
+         </xs:documentation>
+        </xs:annotation>
+        <xs:pattern value="(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*">
+        </xs:pattern>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:attribute>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="keybase">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:element ref="xs:selector"/>
+     <xs:element ref="xs:field" minOccurs="1" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:NCName" use="required"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="identityConstraint">
+  <xs:annotation>
+   <xs:documentation>The three kinds of identity constraints, all with
+                     type of or derived from 'keybase'.
+   </xs:documentation>
+  </xs:annotation>
+  <xs:choice>
+   <xs:element ref="xs:unique"/>
+   <xs:element ref="xs:key"/>
+   <xs:element ref="xs:keyref"/>
+  </xs:choice>
+ </xs:group>
+
+ <xs:element name="unique" type="xs:keybase" id="unique">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-unique"/>
+  </xs:annotation>
+ </xs:element>
+ <xs:element name="key" type="xs:keybase" id="key">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-key"/>
+  </xs:annotation>
+ </xs:element>
+ <xs:element name="keyref" id="keyref">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-keyref"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:keybase">
+     <xs:attribute name="refer" type="xs:QName" use="required"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="notation" id="notation">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-notation"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:attribute name="name" type="xs:NCName" use="required"/>
+     <xs:attribute name="public" type="xs:public"/>
+     <xs:attribute name="system" type="xs:anyURI"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:simpleType name="public">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+   <xs:documentation>
+   A public identifier, per ISO 8879</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:token"/>
+ </xs:simpleType>
+
+ <xs:element name="appinfo" id="appinfo">
+   <xs:annotation>
+     <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-appinfo"/>
+   </xs:annotation>
+   <xs:complexType mixed="true">
+    <xs:sequence minOccurs="0" maxOccurs="unbounded">
+     <xs:any processContents="lax"/>
+    </xs:sequence>
+    <xs:attribute name="source" type="xs:anyURI"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:complexType>
+ </xs:element>
+
+ <xs:element name="documentation" id="documentation">
+   <xs:annotation>
+     <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-documentation"/>
+   </xs:annotation>
+   <xs:complexType mixed="true">
+    <xs:sequence minOccurs="0" maxOccurs="unbounded">
+     <xs:any processContents="lax"/>
+    </xs:sequence>
+    <xs:attribute name="source" type="xs:anyURI"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:complexType>
+ </xs:element>
+
+ <xs:element name="annotation" id="annotation">
+   <xs:annotation>
+     <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-annotation"/>
+   </xs:annotation>
+   <xs:complexType>
+    <xs:complexContent>
+     <xs:extension base="xs:openAttrs">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+       <xs:element ref="xs:appinfo"/>
+       <xs:element ref="xs:documentation"/>
+      </xs:choice>
+      <xs:attribute name="id" type="xs:ID"/>
+     </xs:extension>
+    </xs:complexContent>
+   </xs:complexType>
+ </xs:element>
+
+ <xs:annotation>
+  <xs:documentation>
+   notations for use within XML Schema schemas</xs:documentation>
+ </xs:annotation>
+
+ <xs:notation name="XMLSchemaStructures" public="structures" system="http://www.w3.org/2000/08/XMLSchema.xsd"/>
+ <xs:notation name="XML" public="REC-xml-19980210" system="http://www.w3.org/TR/1998/REC-xml-19980210"/>
+  
+ <xs:complexType name="anyType" mixed="true">
+  <xs:annotation>
+   <xs:documentation>
+   Not the real urType, but as close an approximation as we can
+   get in the XML representation</xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+   <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+  </xs:sequence>
+  <xs:anyAttribute processContents="lax"/>
+ </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+      First the built-in primitive datatypes.  These definitions are for
+      information only, the real built-in definitions are magic.
+    </xs:documentation>
+
+    <xs:documentation>
+      For each built-in datatype in this schema (both primitive and
+      derived) can be uniquely addressed via a URI constructed
+      as follows:
+        1) the base URI is the URI of the XML Schema namespace
+        2) the fragment identifier is the name of the datatype
+
+      For example, to address the int datatype, the URI is:
+
+        http://www.w3.org/2001/XMLSchema#int
+
+      Additionally, each facet definition element can be uniquely
+      addressed via a URI constructed as follows:
+        1) the base URI is the URI of the XML Schema namespace
+        2) the fragment identifier is the name of the facet
+
+      For example, to address the maxInclusive facet, the URI is:
+
+        http://www.w3.org/2001/XMLSchema#maxInclusive
+
+      Additionally, each facet usage in a built-in datatype definition
+      can be uniquely addressed via a URI constructed as follows:
+        1) the base URI is the URI of the XML Schema namespace
+        2) the fragment identifier is the name of the datatype, followed
+           by a period (".") followed by the name of the facet
+
+      For example, to address the usage of the maxInclusive facet in
+      the definition of int, the URI is:
+
+        http://www.w3.org/2001/XMLSchema#int.maxInclusive
+
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="string" id="string">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality" value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#string"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="preserve" id="string.preserve"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="boolean" id="boolean">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#boolean"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse" fixed="true"
+        id="boolean.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="float" id="float">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="total"/>
+        <hfp:hasProperty name="bounded" value="true"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+        <hfp:hasProperty name="numeric" value="true"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#float"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse" fixed="true"
+        id="float.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="double" id="double">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="total"/>
+        <hfp:hasProperty name="bounded" value="true"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+        <hfp:hasProperty name="numeric" value="true"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#double"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="double.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="decimal" id="decimal">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="totalDigits"/>
+        <hfp:hasFacet name="fractionDigits"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="total"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="true"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#decimal"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="decimal.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+   <xs:simpleType name="duration" id="duration">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#duration"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="duration.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+ <xs:simpleType name="dateTime" id="dateTime">
+    <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#dateTime"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="dateTime.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="time" id="time">
+    <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#time"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="time.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="date" id="date">
+   <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#date"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="date.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="gYearMonth" id="gYearMonth">
+   <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gYearMonth"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="gYearMonth.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="gYear" id="gYear">
+    <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gYear"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="gYear.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+ <xs:simpleType name="gMonthDay" id="gMonthDay">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+       <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gMonthDay"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+         <xs:whiteSpace value="collapse" fixed="true"
+                id="gMonthDay.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="gDay" id="gDay">
+    <xs:annotation>
+  <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gDay"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+         <xs:whiteSpace value="collapse"  fixed="true"
+                id="gDay.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+ <xs:simpleType name="gMonth" id="gMonth">
+    <xs:annotation>
+  <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gMonth"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+         <xs:whiteSpace value="collapse"  fixed="true"
+                id="gMonth.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+   <xs:simpleType name="hexBinary" id="hexBinary">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#binary"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse" fixed="true"
+        id="hexBinary.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+ <xs:simpleType name="base64Binary" id="base64Binary">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#base64Binary"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse" fixed="true"
+        id="base64Binary.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+   <xs:simpleType name="anyURI" id="anyURI">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#anyURI"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="anyURI.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+  <xs:simpleType name="QName" id="QName">
+    <xs:annotation>
+        <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#QName"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="QName.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+   <xs:simpleType name="NOTATION" id="NOTATION">
+    <xs:annotation>
+        <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#NOTATION"/>
+      <xs:documentation>
+        NOTATION cannot be used directly in a schema; rather a type
+        must be derived from it by specifying at least one enumeration
+        facet whose value is the name of a NOTATION declared in the
+        schema.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="NOTATION.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+      Now the derived primitive types
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="normalizedString" id="normalizedString">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#normalizedString"/>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:whiteSpace value="replace"
+        id="normalizedString.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="token" id="token">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#token"/>
+    </xs:annotation>
+    <xs:restriction base="xs:normalizedString">
+      <xs:whiteSpace value="collapse" id="token.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="language" id="language">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#language"/>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:pattern
+        value="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"
+                id="language.pattern">
+        <xs:annotation>
+          <xs:documentation
+                source="http://www.ietf.org/rfc/rfc3066.txt">
+            pattern specifies the content of section 2.12 of XML 1.0e2
+            and RFC 3066 (Revised version of RFC 1766).
+          </xs:documentation>
+        </xs:annotation>
+      </xs:pattern>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="IDREFS" id="IDREFS">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#IDREFS"/>
+    </xs:annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list itemType="xs:IDREF"/>
+      </xs:simpleType>
+        <xs:minLength value="1" id="IDREFS.minLength"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="ENTITIES" id="ENTITIES">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#ENTITIES"/>
+    </xs:annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list itemType="xs:ENTITY"/>
+      </xs:simpleType>
+        <xs:minLength value="1" id="ENTITIES.minLength"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="NMTOKEN" id="NMTOKEN">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#NMTOKEN"/>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:pattern value="\c+" id="NMTOKEN.pattern">
+        <xs:annotation>
+          <xs:documentation
+                source="http://www.w3.org/TR/REC-xml#NT-Nmtoken">
+            pattern matches production 7 from the XML spec
+          </xs:documentation>
+        </xs:annotation>
+      </xs:pattern>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="NMTOKENS" id="NMTOKENS">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#NMTOKENS"/>
+    </xs:annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list itemType="xs:NMTOKEN"/>
+      </xs:simpleType>
+        <xs:minLength value="1" id="NMTOKENS.minLength"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Name" id="Name">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#Name"/>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:pattern value="\i\c*" id="Name.pattern">
+        <xs:annotation>
+          <xs:documentation
+                        source="http://www.w3.org/TR/REC-xml#NT-Name">
+            pattern matches production 5 from the XML spec
+          </xs:documentation>
+        </xs:annotation>
+      </xs:pattern>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="NCName" id="NCName">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#NCName"/>
+    </xs:annotation>
+    <xs:restriction base="xs:Name">
+      <xs:pattern value="[\i-[:]][\c-[:]]*" id="NCName.pattern">
+        <xs:annotation>
+          <xs:documentation
+                source="http://www.w3.org/TR/REC-xml-names/#NT-NCName">
+            pattern matches production 4 from the Namespaces in XML spec
+          </xs:documentation>
+        </xs:annotation>
+      </xs:pattern>
+    </xs:restriction>
+  </xs:simpleType>
+
+   <xs:simpleType name="ID" id="ID">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#ID"/>
+    </xs:annotation>
+    <xs:restriction base="xs:NCName"/>
+   </xs:simpleType>
+
+   <xs:simpleType name="IDREF" id="IDREF">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#IDREF"/>
+    </xs:annotation>
+    <xs:restriction base="xs:NCName"/>
+   </xs:simpleType>
+
+   <xs:simpleType name="ENTITY" id="ENTITY">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#ENTITY"/>
+    </xs:annotation>
+    <xs:restriction base="xs:NCName"/>
+   </xs:simpleType>
+
+  <xs:simpleType name="integer" id="integer">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#integer"/>
+    </xs:annotation>
+    <xs:restriction base="xs:decimal">
+      <xs:fractionDigits value="0" fixed="true" id="integer.fractionDigits"/>
+      <xs:pattern value="[\-+]?[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="nonPositiveInteger" id="nonPositiveInteger">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger"/>
+    </xs:annotation>
+    <xs:restriction base="xs:integer">
+      <xs:maxInclusive value="0" id="nonPositiveInteger.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="negativeInteger" id="negativeInteger">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#negativeInteger"/>
+    </xs:annotation>
+    <xs:restriction base="xs:nonPositiveInteger">
+      <xs:maxInclusive value="-1" id="negativeInteger.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="long" id="long">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasProperty name="bounded" value="true"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#long"/>
+    </xs:annotation>
+    <xs:restriction base="xs:integer">
+      <xs:minInclusive value="-9223372036854775808" id="long.minInclusive"/>
+      <xs:maxInclusive value="9223372036854775807" id="long.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="int" id="int">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#int"/>
+    </xs:annotation>
+    <xs:restriction base="xs:long">
+      <xs:minInclusive value="-2147483648" id="int.minInclusive"/>
+      <xs:maxInclusive value="2147483647" id="int.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="short" id="short">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#short"/>
+    </xs:annotation>
+    <xs:restriction base="xs:int">
+      <xs:minInclusive value="-32768" id="short.minInclusive"/>
+      <xs:maxInclusive value="32767" id="short.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="byte" id="byte">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#byte"/>
+    </xs:annotation>
+    <xs:restriction base="xs:short">
+      <xs:minInclusive value="-128" id="byte.minInclusive"/>
+      <xs:maxInclusive value="127" id="byte.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="nonNegativeInteger" id="nonNegativeInteger">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger"/>
+    </xs:annotation>
+    <xs:restriction base="xs:integer">
+      <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="unsignedLong" id="unsignedLong">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasProperty name="bounded" value="true"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#unsignedLong"/>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:maxInclusive value="18446744073709551615"
+        id="unsignedLong.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="unsignedInt" id="unsignedInt">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#unsignedInt"/>
+    </xs:annotation>
+    <xs:restriction base="xs:unsignedLong">
+      <xs:maxInclusive value="4294967295"
+        id="unsignedInt.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="unsignedShort" id="unsignedShort">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#unsignedShort"/>
+    </xs:annotation>
+    <xs:restriction base="xs:unsignedInt">
+      <xs:maxInclusive value="65535"
+        id="unsignedShort.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="unsignedByte" id="unsignedByte">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#unsignedByte"/>
+    </xs:annotation>
+    <xs:restriction base="xs:unsignedShort">
+      <xs:maxInclusive value="255" id="unsignedByte.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="positiveInteger" id="positiveInteger">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#positiveInteger"/>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:minInclusive value="1" id="positiveInteger.minInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+ <xs:simpleType name="derivationControl">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:NMTOKEN">
+   <xs:enumeration value="substitution"/>
+   <xs:enumeration value="extension"/>
+   <xs:enumeration value="restriction"/>
+   <xs:enumeration value="list"/>
+   <xs:enumeration value="union"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:group name="simpleDerivation">
+  <xs:choice>
+    <xs:element ref="xs:restriction"/>
+    <xs:element ref="xs:list"/>
+    <xs:element ref="xs:union"/>
+  </xs:choice>
+ </xs:group>
+
+ <xs:simpleType name="simpleDerivationSet">
+  <xs:annotation>
+   <xs:documentation>
+   #all or (possibly empty) subset of {restriction, union, list}
+   </xs:documentation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:union>
+   <xs:simpleType>
+    <xs:restriction base="xs:token">
+     <xs:enumeration value="#all"/>
+    </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType>
+    <xs:list>
+     <xs:simpleType>
+      <xs:restriction base="xs:derivationControl">
+       <xs:enumeration value="list"/>
+       <xs:enumeration value="union"/>
+       <xs:enumeration value="restriction"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:list>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+  <xs:complexType name="simpleType" abstract="true">
+    <xs:complexContent>
+      <xs:extension base="xs:annotated">
+        <xs:group ref="xs:simpleDerivation"/>
+        <xs:attribute name="final" type="xs:simpleDerivationSet"/>
+        <xs:attribute name="name" type="xs:NCName">
+          <xs:annotation>
+            <xs:documentation>
+              Can be restricted to required or forbidden
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="topLevelSimpleType">
+    <xs:complexContent>
+      <xs:restriction base="xs:simpleType">
+        <xs:sequence>
+          <xs:element ref="xs:annotation" minOccurs="0"/>
+          <xs:group ref="xs:simpleDerivation"/>
+        </xs:sequence>
+        <xs:attribute name="name" use="required"
+             type="xs:NCName">
+          <xs:annotation>
+            <xs:documentation>
+              Required at the top level
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+       <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="localSimpleType">
+    <xs:complexContent>
+      <xs:restriction base="xs:simpleType">
+        <xs:sequence>
+          <xs:element ref="xs:annotation" minOccurs="0"/>
+          <xs:group ref="xs:simpleDerivation"/>
+        </xs:sequence>
+        <xs:attribute name="name" use="prohibited">
+          <xs:annotation>
+            <xs:documentation>
+              Forbidden when nested
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="final" use="prohibited"/>
+       <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="simpleType" type="xs:topLevelSimpleType" id="simpleType">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-simpleType"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:group name="facets">
+   <xs:annotation>
+    <xs:documentation>
+       We should use a substitution group for facets, but
+       that's ruled out because it would allow users to
+       add their own, which we're not ready for yet.
+    </xs:documentation>
+   </xs:annotation>
+   <xs:choice>
+    <xs:element ref="xs:minExclusive"/>
+    <xs:element ref="xs:minInclusive"/>
+    <xs:element ref="xs:maxExclusive"/>
+    <xs:element ref="xs:maxInclusive"/>
+    <xs:element ref="xs:totalDigits"/>
+    <xs:element ref="xs:fractionDigits"/>
+    <xs:element ref="xs:length"/>
+    <xs:element ref="xs:minLength"/>
+    <xs:element ref="xs:maxLength"/>
+    <xs:element ref="xs:enumeration"/>
+    <xs:element ref="xs:whiteSpace"/>
+    <xs:element ref="xs:pattern"/>
+   </xs:choice>
+  </xs:group>
+
+  <xs:group name="simpleRestrictionModel">
+   <xs:sequence>
+    <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/>
+    <xs:group ref="xs:facets" minOccurs="0" maxOccurs="unbounded"/>
+   </xs:sequence>
+  </xs:group>
+
+  <xs:element name="restriction" id="restriction">
+   <xs:complexType>
+    <xs:annotation>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#element-restriction">
+          base attribute and simpleType child are mutually
+          exclusive, but one or other is required
+        </xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+        <xs:extension base="xs:annotated">
+         <xs:group ref="xs:simpleRestrictionModel"/>
+         <xs:attribute name="base" type="xs:QName" use="optional"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="list" id="list">
+   <xs:complexType>
+    <xs:annotation>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#element-list">
+          itemType attribute and simpleType child are mutually
+          exclusive, but one or other is required
+        </xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+        <xs:extension base="xs:annotated">
+          <xs:sequence>
+            <xs:element name="simpleType" type="xs:localSimpleType"
+                minOccurs="0"/>
+          </xs:sequence>
+          <xs:attribute name="itemType" type="xs:QName" use="optional"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="union" id="union">
+   <xs:complexType>
+    <xs:annotation>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#element-union">
+          memberTypes attribute must be non-empty or there must be
+          at least one simpleType child
+        </xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+        <xs:extension base="xs:annotated">
+          <xs:sequence>
+            <xs:element name="simpleType" type="xs:localSimpleType"
+                minOccurs="0" maxOccurs="unbounded"/>
+          </xs:sequence>
+          <xs:attribute name="memberTypes" use="optional">
+            <xs:simpleType>
+              <xs:list itemType="xs:QName"/>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:complexType name="facet">
+    <xs:complexContent>
+      <xs:extension base="xs:annotated">
+        <xs:attribute name="value" use="required"/>
+        <xs:attribute name="fixed" type="xs:boolean" use="optional"
+                      default="false"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+ <xs:complexType name="noFixedFacet">
+  <xs:complexContent>
+   <xs:restriction base="xs:facet">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="fixed" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+  <xs:element name="minExclusive" id="minExclusive" type="xs:facet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-minExclusive"/>
+    </xs:annotation>
+  </xs:element>
+  <xs:element name="minInclusive" id="minInclusive" type="xs:facet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-minInclusive"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:element name="maxExclusive" id="maxExclusive" type="xs:facet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-maxExclusive"/>
+    </xs:annotation>
+  </xs:element>
+  <xs:element name="maxInclusive" id="maxInclusive" type="xs:facet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-maxInclusive"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:complexType name="numFacet">
+    <xs:complexContent>
+      <xs:restriction base="xs:facet">
+       <xs:sequence>
+         <xs:element ref="xs:annotation" minOccurs="0"/>
+       </xs:sequence>
+       <xs:attribute name="value" type="xs:nonNegativeInteger" use="required"/>
+       <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="totalDigits" id="totalDigits">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-totalDigits"/>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:restriction base="xs:numFacet">
+          <xs:sequence>
+            <xs:element ref="xs:annotation" minOccurs="0"/>
+          </xs:sequence>
+          <xs:attribute name="value" type="xs:positiveInteger" use="required"/>
+         <xs:anyAttribute namespace="##other" processContents="lax"/>
+        </xs:restriction>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="fractionDigits" id="fractionDigits" type="xs:numFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-fractionDigits"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:element name="length" id="length" type="xs:numFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-length"/>
+    </xs:annotation>
+  </xs:element>
+  <xs:element name="minLength" id="minLength" type="xs:numFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-minLength"/>
+    </xs:annotation>
+  </xs:element>
+  <xs:element name="maxLength" id="maxLength" type="xs:numFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-maxLength"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:element name="enumeration" id="enumeration" type="xs:noFixedFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-enumeration"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:element name="whiteSpace" id="whiteSpace">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-whiteSpace"/>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:restriction base="xs:facet">
+          <xs:sequence>
+            <xs:element ref="xs:annotation" minOccurs="0"/>
+          </xs:sequence>
+          <xs:attribute name="value" use="required">
+            <xs:simpleType>
+              <xs:restriction base="xs:NMTOKEN">
+                <xs:enumeration value="preserve"/>
+                <xs:enumeration value="replace"/>
+                <xs:enumeration value="collapse"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+         <xs:anyAttribute namespace="##other" processContents="lax"/>
+        </xs:restriction>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="pattern" id="pattern">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-pattern"/>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:restriction base="xs:noFixedFacet">
+          <xs:sequence>
+            <xs:element ref="xs:annotation" minOccurs="0"/>
+          </xs:sequence>
+          <xs:attribute name="value" type="xs:string" use="required"/>
+         <xs:anyAttribute namespace="##other" processContents="lax"/>
+        </xs:restriction>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
diff --git a/SDT/schema4.0/etc/anttasks.xml b/SDT/schema4.0/etc/anttasks.xml
new file mode 100644
index 0000000000000000000000000000000000000000..1d731eb838bc3561c223738a36b676adc1593d53
--- /dev/null
+++ b/SDT/schema4.0/etc/anttasks.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="anttasks" default="build">
+
+
+<!-- ant-contribs -->
+<taskdef resource="net/sf/antcontrib/antlib.xml">
+  <classpath>
+    <pathelement location="${path.libs}/ant/ant-contrib-1.0b3.jar"/>
+  </classpath>
+</taskdef>
+
+<!-- Set the log level -->
+<taskdef	name="setloglevel"		
+			classname="de.berkom.ehome.tools.ant.setloglevel.SetLogLevel" 
+			classpath="${path.libs}/ant/antSetLogLevel.jar"/>
+
+</project>
+
diff --git a/SDT/schema4.0/etc/common.xml b/SDT/schema4.0/etc/common.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c05a65e7966231a0e874e8f25c48e41362e69b7b
--- /dev/null
+++ b/SDT/schema4.0/etc/common.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="imported" default="build">
+
+<!-- TODOs
+
+	* genjar integration
+	* if no manifest is available include a defalt one from etc?
+-->
+
+
+<property name="path.libs"					location="${basedir}/lib" />
+
+<!-- Load various tasks -->
+<import file="anttasks.xml" />
+
+<!-- Unset the _mainbuild property -->
+<var name="_mainbuild" unset="true" />
+
+<!-- Load the properties -->
+<import file="properties.xml" />
+
+
+<!-- Load all the actual tasks -->
+<import file="tasks/all.xml" />
+<import file="tasks/allforced.xml" />
+<import file="tasks/build.xml" />
+<import file="tasks/buildjar.xml" />
+<import file="tasks/clean.xml" />
+<import file="tasks/collect.xml" />
+<import file="tasks/compile.xml" />
+<import file="tasks/compilenative.xml" />
+<import file="tasks/doc.xml" />
+<import file="tasks/eclipse.xml" />
+
+<import file="tasks/_addPrivateLibs.xml" />
+<import file="tasks/_buildNative.xml" />
+<import file="tasks/_checkDependentProjects.xml" />
+<import file="tasks/_cleanDependentProjects.xml" />
+<import file="tasks/_getBuildNumber.xml" />
+<import file="tasks/_handleProjectProperties.xml" />
+<import file="tasks/_includeExternalResourcesInJar.xml" />
+<!-- <import file="tasks/_importManifest.xml" /> -->
+<import file="tasks/_prepare.xml" />
+<import file="tasks/_preparebuild.xml" />
+<import file="tasks/_setClassPath.xml" />
+
+
+</project>
diff --git a/SDT/schema4.0/etc/dal.rnc b/SDT/schema4.0/etc/dal.rnc
new file mode 100644
index 0000000000000000000000000000000000000000..728c734c43e4858e61cef9136e7e35a93ad60f8e
--- /dev/null
+++ b/SDT/schema4.0/etc/dal.rnc
@@ -0,0 +1,15 @@
+
+namespace local = ""
+default namespace xsl = "http://homegatewayinitiative.org/xml/dal/3.0"
+namespace xi = "http://www.w3.org/2001/XInclude"
+
+version = "1.0"
+
+include "domain.rnc"
+
+xinclude = element xi:include {
+    attribute href { xsd:anyURI },
+    attribute parse { text }
+  }
+
+Imports = element Imports { xinclude* }?
diff --git a/SDT/schema4.0/etc/default.properties b/SDT/schema4.0/etc/default.properties
new file mode 100644
index 0000000000000000000000000000000000000000..6c1e9ad0f26632f0d0c7375c229a08b02eef79e0
--- /dev/null
+++ b/SDT/schema4.0/etc/default.properties
@@ -0,0 +1,124 @@
+# Default Properties for the Ant make system
+#
+
+#
+#	Default libraries.
+#	Update accordingly if another library becomes the system's default library
+#
+
+default.lib.cdc.foundation.1.1=cdc/foundation/1.1/classes.zip
+
+default.lib.osgi.core.2.0=osgi/framework/2.0/osgi.jar
+default.lib.osgi.cmpn.2.0=osgi/framework/2.0/osgi.jar
+
+default.lib.osgi.core.3.0=osgi/framework/3.0/osgi.jar
+default.lib.osgi.cmpn.3.0=osgi/framework/3.0/osgi.jar
+
+default.lib.osgi.core.4.0=osgi/core/4.0/osgi.core.jar
+default.lib.osgi.core.4.1=osgi/core/4.1/osgi.core.jar
+default.lib.osgi.core.4.2=osgi/core/4.2/osgi.core.jar
+default.lib.osgi.core=osgi/core/4.2/osgi.core.jar
+
+default.lib.osgi.cmpn.4.0=osgi/cmpn/4.0/osgi.compendium.jar
+default.lib.osgi.cmpn.4.1=osgi/cmpn/4.1/osgi.cmpn.jar
+default.lib.osgi.cmpn.4.2=osgi/cmpn/4.2/osgi.cmpn.jar
+default.lib.osgi.cmpn=osgi/cmpn/4.2/osgi.cmpn.jar
+
+default.lib.osgi.dmt.1.0=osgi/info/1.0/dmt.jar
+default.lib.osgi.dmt.2.0=osgi/info/2.0/org.osgi.impl.service.dmt.jar
+default.lib.osgi.dmt=osgi/info/2.0/org.osgi.impl.service.dmt.jar
+
+
+default.lib.mail.1.4.prosyst=javax/mail/1.4-prosyst/mail.jar
+default.lib.mail=javax/mail/1.4-prosyst/mail.jar
+
+default.lib.activation.1.1.prosyst=javax/activation/1.1-prosyst/activation.jar
+default.lib.activation=javax/activation/1.1-prosyst/activation.jar
+
+default.lib.j2ee.1.3.1=javax/j2ee/1.3.1/j2ee.jar
+default.lib.j2ee=javax/j2ee/1.3.1/j2ee.jar
+
+# - Servlet APIs ---------------------------------------------------------------
+#
+#   With the addition of the SIP-Servlet API, and it's dependency on newer 
+#   version of the Servlet API, I thought names matching the Sun package
+#   structure would be clearer. Kept the old definition as well.
+
+default.lib.servlet.2.3.1=javax/servlet/2.3.1/servlet.jar
+default.lib.servlet=javax/servlet/2.3.1/servlet.jar
+
+default.lib.javax.servlet.2.3.1=javax/servlet/2.3.1/servlet.jar
+default.lib.javax.servlet.2.4=javax/servlet/2.4/servlet.jar
+default.lib.javax.servlet.2.5=javax/servlet/2.5/servlet.jar
+default.lib.javax.servlet.3.0.1=javax/servlet/3.0.1/servlet.jar
+default.lib.javax.servlet=javax/servlet/2.3.1/servlet.jar
+
+default.lib.javax.sip.servlet.1.1=javax/servlet/sip/1.1/sip-servlet.jar
+default.lib.javax.sip.servlet=javax/servlet/sip/1.1/sip-servlet.jar
+
+# ------------------------------------------------------------------------------
+
+default.lib.log4j=apache/log4j/1.2.4/log4j-1.2.4.jar
+
+default.lib.jgraph=jgraph/5.12.0.4/jgraph.jar
+
+default.lib.thinlet.20031012=thinlet/20031012/thinlet.jar
+default.lib.thinlet.20050328=thinlet/20050328/thinlet.jar
+default.lib.thinlet.20070222=thinlet/20070222/thinlet.jar
+default.lib.thinlet=thinlet/20070222/thinlet.jar
+
+default.lib.id3tag=id3tag/id3t.jar
+default.lib.xmlrpc=prosyst/xmlrpc/xmlrpc.jar
+
+# - CDC/Foundation Extensions -------------------------------------------------
+
+default.lib.cdc.foundationx.j9jsse=cdc/foundationx/j9jsse/2.4/j9jsse.jar
+
+# -----------------------------------------------------------------------------
+# Note: We should not require dependencies on the ProSyst HTTPS Handler!
+
+default.lib.httpshdlr=prosyst/httpshdlr.jar
+
+default.lib.ksoap2=ksoap2/ksoap2-j2se-full-2.1.0.jar
+default.lib.kxml=ksoap2/kxml2-2.3.0.jar
+
+
+# -----------------------------------------------------------------------------
+default.lib.xmlrpc=xmlrpc/xmlrpc-1.1.1.jar
+
+# -----------------------------------------------------------------------------
+
+#
+#	Default version number
+#	(I'm wondering whether anybody will set this in his build properties)
+#
+version=1.0.0
+
+#
+#	The default Manifest file.
+#	This might change if we adopt the bnd tool
+#
+manifest=etc/Manifest.mf
+
+#
+#	Add a build number to the resulting jar file. 
+#	The file "build.number" in the root directory of each project contains the latest build number.
+#	Default: The value "none" means that no build number is appended.
+#
+buildnumber=none
+
+#
+#	Set the loglevel.
+#	Possible loglevel: debug,verbose,info (the ant default), warning, error
+#	Default is warning, which is rather quiet.
+#
+loglevel=warning
+
+
+#
+#	Enable lint (all recommend warnings)
+#	Possible values: true, false
+#	Default: false
+#
+uselint=false
+
diff --git a/SDT/schema4.0/etc/domain.rnc b/SDT/schema4.0/etc/domain.rnc
new file mode 100644
index 0000000000000000000000000000000000000000..1fdb1f2008cf338881a3df25d2d14ef1041c1ef5
--- /dev/null
+++ b/SDT/schema4.0/etc/domain.rnc
@@ -0,0 +1,152 @@
+# - domain.rng
+# -
+# - Version 4.0
+# -
+# - This work is released by the MAS Working Group of oneM2M, December 2018.
+# - The work is created and released under the 3-Clause BSD License.
+# - See the license text at [https://opensource.org/licenses/BSD-3-Clause for
+# - full details.
+
+start = Domain
+Domain =
+  element Domain {
+    attribute xml:base { xsd:anyURI }?,
+    attribute id { xsd:ID },
+    DocDef,
+    element Imports { Domain+ }?,
+    element Modules {
+      element ModuleClass { ModuleDef }+
+    }?,
+    element Devices {
+      element Device {
+        attribute id { xsd:Name },
+        DocDef,
+        PropertiesDef?,
+        Modules?,
+        element SubDevices {
+          element SubDevice {
+            attribute id { xsd:Name },
+            DocDef,
+            PropertiesDef?,
+            Modules?
+          }+
+        }?
+      }+
+    }?
+  }
+PropertiesDef =
+  element Properties {
+    element Property {
+      attribute name { text },
+      attribute optional { xsd:boolean }?,
+      attribute value { text }?,
+      DocDef,
+      SimpleType
+    }+
+  }
+DataTypeDef =
+  element DataType {
+    attribute name { text }?,
+    attribute unitOfMeasure { text }?,
+    DocDef,
+    (StructType | ArrayType | SimpleType),
+    ConstraintsDef?
+  }
+StructType = element Struct { DataTypeDef+ }
+ArrayType = element Array { DataTypeDef }
+SimpleType =
+  element SimpleType {
+    attribute type { BasicType }
+  }
+BasicType =
+  "integer"
+  | "boolean"
+  | "string"
+  | "byte"
+  | "float"
+  | "array"
+  | "enum"
+  | "date"
+  | "time"
+  | "datetime"
+  | "blob"
+  | "uri"
+ConstraintsDef =
+  element Constraints {
+    element Constraint {
+      attribute name { text },
+      attribute type { BasicType }?,
+      attribute value { text }?,
+      DocDef
+    }+
+  }
+DocText =
+  (text
+   | element em { text }
+   | element b { text }
+   | element tt { text })*
+# <Doc> element is always optional
+DocDef =
+  element Doc {
+    DocText
+    | (element p { DocText }
+       | element img {
+           attribute src { text },
+           element caption { text }
+         })*
+  }?
+ModuleDef =
+  attribute name { text },
+  attribute optional { xsd:boolean }?,
+  element extends {
+    attribute domain { xsd:IDREF },
+    attribute class { text }
+  }?,
+  DocDef,
+  PropertiesDef?,
+  Actions?,
+  Data?,
+  Events?
+Modules =
+  element Modules {
+    element Module { ModuleDef }+
+  }
+Actions =
+  element Actions {
+    element Action {
+      attribute name { text },
+      attribute optional { xsd:boolean }?,
+      DocDef,
+      DataTypeDef?,
+      ArgDef?
+    }+
+  }
+ArgDef =
+  element Args {
+    element Arg {
+      attribute name { text },
+      DocDef,
+      DataTypeDef
+    }+
+  }
+Data =
+  element Data {
+    element DataPoint {
+      attribute name { text },
+      attribute optional { xsd:boolean }?,
+      attribute writable { xsd:boolean }?,
+      attribute readable { xsd:boolean }?,
+      attribute eventable { xsd:boolean }?,
+      DocDef,
+      DataTypeDef
+    }+
+  }
+Events =
+  element Events {
+    element Event {
+      attribute name { text },
+      attribute optional { xsd:boolean }?,
+      DocDef,
+      Data?
+    }+
+  }
diff --git a/SDT/schema4.0/etc/properties.xml b/SDT/schema4.0/etc/properties.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ce8aba6bd44a74c609b638b4d82424b492fbe3b0
--- /dev/null
+++ b/SDT/schema4.0/etc/properties.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="properties" default="build">
+
+<!-- Set the default project name to the name of the directory --> 
+<propertyregex	override="yes" 
+				property="projectname"
+				input="${basedir}"
+				regexp=".*[/\\]([^/\\]*)"
+				select="\1" />
+				
+<!-- A couple of constants -->
+<property name="path.base"						location="${basedir}" />
+<property name="path.libs"						location="${path.base}/libs" />
+<property name="path.etc"						location="${path.base}/etc" />
+<property name="path.genbase"					location="${path.base}/gen" />
+<property name="path.gen"						location="${path.genbase}/projects/${projectname}" />
+<property name="path.gen.classes"				location="${path.gen}/classes" />
+<property name="path.gen.etc"					location="${path.gen}/etc" />
+<property name="path.gen.docbase"				location="${path.genbase}/docs" />
+<property name="path.gen.documentation"			location="${path.gen.docbase}/${projectname}" />
+<property name="path.gen.collection"			location="${path.genbase}/collection" />
+<property name="path.gen.domain"				location="${path.genbase}/domains" />
+<property name="path.src"						location="${basedir}/src" />
+<property name="path.resources"					location="${basedir}/resources" />
+<property name="path.native"					location="${basedir}/native" />
+<property name="path.gen.native"				location="${path.gen}/native" />
+<property name="path.gen.classpathfile"			location="${path.gen.etc}/_classpath" />
+<property name="path.gen.includecmdfile"		location="${path.gen.etc}/_jarinclude.xml" />
+<property name="path.gen.importmanifestcmdfile"	location="${path.gen.etc}/_manifestimport.xml" />
+<property name="path.etc.localfile"				location="${path.base}/etc/local.xml" />
+<property name="path.eclipse.classpathfile"		location="${basedir}/.classpath" />
+<property name="path.eclipse.projectfile"		location="${basedir}/.project" />
+<property name="path.eclipse.settingsdir"		location="${basedir}/.settings" />
+<property name="path.eclipse.settingsfile"		location="${path.eclipse.settingsdir}/org.eclipse.jdt.core.prefs" />
+
+
+
+<!-- The following tasks only need to be executed when this file is not included from the main build file -->
+<if><not>
+		<isset property="_mainbuild" />
+	</not>
+	<then>
+		<!-- Unset the java.target and java.source properties -->
+		<var name="java.target" unset="true" />
+		<var name="java.source" unset="true" />
+
+		<!-- Load project specific properties from local properties file -->
+		<loadproperties srcFile="properties" />		
+
+		<!-- Load project specific properties from local properties file -->
+		<loadproperties srcFile="etc/default.properties" />		
+
+		<!-- Set the start loglevel -->
+		<setloglevel level="${loglevel}" /> 
+
+	</then>
+</if>
+
+<!-- Define the path to additional Java jar files for the scriptdef and similar tasks -->
+<path id="antscripting">
+	<fileset dir="${path.libs}/ant/scripting" includes="*.jar" />
+</path>
+
+
+<!-- set the default Java source and target formats to the local versions -->
+<if><not>
+		<isset property="java.source" />
+	</not>
+	<then>
+		<var name="java.source" value="${ant.java.version}" />
+	</then>
+</if>
+<if><not>
+		<isset property="java.target" />
+	</not>
+	<then>
+		<var name="java.target" value="${ant.java.version}" />
+	</then>
+</if>
+
+
+<!-- load local properties, if the file exists -->
+<available property="available.local" file="${path.etc.localfile}"/>
+<if><isset property="available.local" />
+	<then>
+		<import file="${path.etc.localfile}" />
+	</then>
+</if>
+
+
+</project>
diff --git a/SDT/schema4.0/etc/schema.xmlns b/SDT/schema4.0/etc/schema.xmlns
new file mode 100644
index 0000000000000000000000000000000000000000..4f691f5342ddd84d3301215f2286a9cd3887822d
--- /dev/null
+++ b/SDT/schema4.0/etc/schema.xmlns
@@ -0,0 +1,4 @@
+targetNamespace="http://homegatewayinitiative.org/xml/dal/3.0" 
+	   xmlns="http://homegatewayinitiative.org/xml/dal/3.0" 
+	   xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+	  
diff --git a/SDT/schema4.0/etc/schemas.xml b/SDT/schema4.0/etc/schemas.xml
new file mode 100644
index 0000000000000000000000000000000000000000..3b0bea68871bb789a0a90378c2c425b777e77199
--- /dev/null
+++ b/SDT/schema4.0/etc/schemas.xml
@@ -0,0 +1,9 @@
+<locatingRules xmlns="http://thaiopensource.com/ns/locating-rules/1.0">
+  
+  <namespace ns="http://homegatewayinitiative.org/xml/dal/2.0" typeId="DAL"/>
+  <namespace ns="http://www.w3.org/2001/XInclude" typeId="XINC"/>
+
+  <typeId id="DAL" uri="dal.rnc"/>
+  <typeId id="XINC" uri="xinclude.rnc"/>
+
+</locatingRules>
diff --git a/SDT/schema4.0/etc/tasks/_addPrivateLibs.xml b/SDT/schema4.0/etc/tasks/_addPrivateLibs.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b6a4fcad28e10ae82d353881e8433be9c4513be7
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_addPrivateLibs.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_addPrivateLibs" default="build">
+
+
+<!--	INTERNAL: _addPrivateLibs
+		Check, whether there are privare jars that should be added to the classpath.
+		Those must be located under resouces/libs or libs in the project directory.
+		Note that jars under resources/libs will be included in the resulting jar.
+-->
+<target name="_addPrivateLibs">
+	<!-- look for jar files in the projects resources libs directory -->
+	<path id="idPrivatelibs">
+		<fileset dir="resources/libs">
+			<include name="*.jar" />
+		</fileset>
+	</path>
+
+	<trycatch>
+		<try>
+			<!-- try to access the private jars. If those don't exist, the following code is *not* executed -->
+			<var name="tmp" value="${toString:idPrivatelibs}" />
+			<!-- add them to the classpath file -->
+			<for list="${tmp}" delimiter=":" param="jfile">
+			<sequential>
+				<propertyregex	override="yes" 
+								property="tmp"
+								input="@{jfile}"
+								regexp=".*[/\\]([^/\\]*)"
+								select="\1" />
+				<echo file="${path.gen.classpathfile}" append="true">projects/${projectname}/resources/libs/${tmp}${line.separator}</echo>
+			</sequential>
+			</for>
+		</try>
+		<catch>
+			<!-- if no lib available then do nothing -->
+		</catch>
+	</trycatch>
+
+
+	<path id="idPrivateExternallibs">
+		<fileset dir="libs">
+			<include name="*.jar" />
+		</fileset>
+
+	</path>
+
+	<trycatch>
+		<try>
+			<!-- try to access the private jars. If those don't exist, the following code is *not* executed -->
+			<var name="tmp" value="${toString:idPrivateExternallibs}" />
+			<!-- add them to the classpath file -->
+			<for list="${tmp}" delimiter=":" param="jfile">
+			<sequential>
+				<propertyregex	override="yes" 
+								property="tmp"
+								input="@{jfile}"
+								regexp=".*[/\\]([^/\\]*)"
+								select="\1" />
+				<echo file="${path.gen.classpathfile}" append="true">projects/${projectname}/libs/${tmp}${line.separator}</echo>
+			</sequential>
+			</for>
+		</try>
+		<catch>
+			<!-- if no lib available then do nothing -->
+		</catch>
+	</trycatch>
+
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_buildNative.xml b/SDT/schema4.0/etc/tasks/_buildNative.xml
new file mode 100644
index 0000000000000000000000000000000000000000..2d03b5dea4c6dcdeb9937d8060f4dcfb1bf758fc
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_buildNative.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_buildNative" default="build">
+
+<!--	INTERNAL: _buildNative
+		Build all native code
+-->
+
+<target name="_buildNative">
+	<!-- is there a directory for native code? -->
+	<available property="available.native" file="${path.native}" type="dir"/>
+	<if><isset property="available.native" />
+		<then>
+
+			<!-- check whether ${prog.make} is set -->
+			<if> <isset property="prog.make" />
+				<then>
+
+					<!-- it is set, so go all the directories unter "native" and execute the Makefile -->
+					<path id="idNativeDirs"> 
+						<dirset dir="${path.native}">
+							<include name="*" />
+						</dirset>
+					</path>
+
+					<!-- iterate over all directories and call the makefile -->
+					<var name="tmp" value="${toString:idNativeDirs}" />
+					<for list="${tmp}" delimiter=":" param="ndir">
+						<sequential>
+							<available property="available.native.makefile" file="@{ndir}/Makefile" />
+							<if><isset property="available.native.makefile" />
+								<then>
+									<echo>@{ndir}/Makefile</echo>
+
+		<!--							<exec	executable="/usr/bin/make"
+											failonerror="false"
+											failifexecutionfails="false"
+											resultproperty="myStatus"
+											errorproperty="/tmp/error.out"
+											outputproperty="/tmp/foo.out"
+											error="/tmp/error.txt"
+											output="/tmp/output.txt"/>
+											-->
+
+								</then>
+								<else>
+									<echo>No "Makefile" found. Please check the check (note the upper-case M).</echo>
+								</else>
+							</if>
+							<echo>@{ndir}</echo>
+						</sequential>
+					</for>
+				</then>
+				<else>
+					<echo>Property "prog.make" not set. Native Builds are ignored.</echo>
+				</else>
+			</if>
+
+
+
+		
+		</then>
+	</if>
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_checkDependentProjects.xml b/SDT/schema4.0/etc/tasks/_checkDependentProjects.xml
new file mode 100644
index 0000000000000000000000000000000000000000..6ad985573a996e31702c7a2fd60610f9a5b0bd0f
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_checkDependentProjects.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_checkDependentProjects" default="build">
+
+<!--	INTERNAL:	_checkDependentProjects
+		Check whether there are dependencies to other projects and build them if necessary.
+-->
+<target name="_checkDependentProjects">
+	<if><and>
+			<isset property="dependency.projects" />
+			<length string="${dependency.projects}" trim="true" when="greater" length="0" />	
+		</and>
+		<then>
+			<!-- go through all dependent projects -->
+			<for list="${dependency.projects}" param="pname">
+			<sequential>
+				<available property="available.dir.@{pname}" file="../@{pname}" />
+				<available property="available.gen.@{pname}" file="../../gen/projects/@{pname}" />
+
+				<!-- does the project exist at all? -->
+				<if><isset property="available.dir.@{pname}" />
+					<then>
+						<!-- look for jar files in the according project's gen directory -->
+						<path id="x">
+							<fileset dir="../../gen/projects/@{pname}">
+								<include name="*.jar" />
+							</fileset>
+						</path>
+
+						<trycatch>
+							<try>
+								<echo>Checking dependent project "@{pname}"</echo>
+								<var name="tmp" value="${toString:x}" />
+								<if><isset property="dependency.projects.forcebuild" />
+									<then>
+										<echo>Building dependent project "@{pname}" (forced)</echo>
+										<if><isset property="global.build" />	<!-- inheriting global.build property, if set -->
+											<then>
+												<ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" target="all">
+													<property name="global.build" value="true" />
+												</ant>
+											</then>
+											<else>
+												<ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" target="all" />
+											</else>
+										</if>
+									</then>
+								</if>
+							</try>
+							<catch>
+								<!-- if no jar file available, build the project -->
+								<echo>Building dependent project "@{pname}"</echo>
+								<if><isset property="global.build" />	<!-- inheriting global.build property, if set -->
+									<then>
+										<ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" >
+											<property name="global.build" value="true" />
+										</ant>
+									</then>
+									<else>
+										<ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" />
+									</else>
+								</if>
+							</catch>
+						</trycatch>
+
+						<!-- and try again -->
+						<trycatch>
+							<try>
+								<var name="tmp" value="${toString:x}" />
+								<echo>Dependent project "@{pname}": ok</echo>
+								<for list="${tmp}" delimiter=":" param="jfile">
+								<sequential>
+									<!--echo file="${path.gen.classpathfile}" append="true">@{jfile}${line.separator}</echo-->
+									<propertyregex	override="yes" 
+													property="tmp"
+													input="@{jfile}"
+													regexp=".*[/\\]([^/\\]*)"
+													select="\1" />
+									<echo file="${path.gen.classpathfile}" append="true">gen/projects/@{pname}/${tmp}${line.separator}</echo>
+								</sequential>
+								</for>
+							</try>
+							<catch>
+								<fail>.${line.separator}${line.separator}Can't resolve dependency to project "@{pname}". Aborting.${line.separator}Perhaps that project was not build (check the property 'gobal.build.ignore').</fail>
+							</catch>
+						</trycatch>
+					</then>
+				</if>
+			</sequential>
+			</for>
+		</then>
+	</if>
+</target>
+
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_cleanDependentProjects.xml b/SDT/schema4.0/etc/tasks/_cleanDependentProjects.xml
new file mode 100644
index 0000000000000000000000000000000000000000..851233972d0b0a7bc1cc7f91ba6d43aa131e2a75
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_cleanDependentProjects.xml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_cleanDependentProjects" default="build">
+
+<!--	INTERNAL:	_cleanDependentProjects
+		Check whether there are dependencies to other projects and clean them.
+-->
+<target name="_cleanDependentProjects">
+	<if><and>
+			<isset property="dependency.projects" />
+			<length string="${dependency.projects}" trim="true" when="greater" length="0" />	
+		</and>
+		<then>
+			<!-- go through all dependent projects -->
+			<for list="${dependency.projects}" param="pname">
+			<sequential>
+				<available property="available.dir.@{pname}" file="../@{pname}" />
+
+				<!-- does the project exist at all? -->
+				<if><isset property="available.dir.@{pname}" />
+					<then>
+						<echo>Cleaning dependent project "@{pname}"</echo>
+						<var name="tmp" value="${toString:x}" />
+						<if><isset property="global.build" />	<!-- inheriting global.build property, if set -->
+							<then>
+								<ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" target="clean">
+									<property name="global.build" value="true" />
+								</ant>
+							</then>
+							<else>
+								<ant dir="../@{pname}" inheritall="false" antfile="../@{pname}/build.xml" target="clean" />
+							</else>
+						</if>
+					</then>
+				</if>
+			</sequential>
+			</for>
+		</then>
+	</if>
+</target>
+
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_getBuildNumber.xml b/SDT/schema4.0/etc/tasks/_getBuildNumber.xml
new file mode 100644
index 0000000000000000000000000000000000000000..ea24ad5ffa9e8948cdb09abf0d2ef28d4bbf535b
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_getBuildNumber.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_getBuildNumber" default="build">
+
+
+<!--	INTERNAL:	_getBuildNumber
+		Add the build number to the jar file name, if necessary.
+-->
+<target name="_getBuildNumber">
+	<if><and>
+			<isset property="buildnumber" />
+			<not>
+				<equals arg1="${buildnumber}" arg2="none" />
+			</not>
+		</and>
+		<then>
+			<buildnumber />
+			<propertyregex	property="tmp"
+							override="true"
+							input="${file.jar}"
+							regexp="(.*).jar"
+							select="\1" />
+
+			<var name="file.jar" value="${tmp}-${build.number}.jar" />
+		</then>
+	</if>
+
+</target>
+	
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_handleProjectProperties.xml b/SDT/schema4.0/etc/tasks/_handleProjectProperties.xml
new file mode 100644
index 0000000000000000000000000000000000000000..4bccaa8b7d14da65300543fb336a4f48e54f6ce5
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_handleProjectProperties.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_handleProjectProperties" default="build">
+
+<!--	INTERNAL: _handleProjectProperties
+		Calculate and the project properties
+-->
+<target name="_handleProjectProperties">
+
+	<!-- go through all properties that start with "dependency.lib." -->
+	<propertyselector property="libs.list" 
+						override="yes"
+						delimiter="," 
+						match="^dependency\.lib\.(.*)" 
+						select="\1"
+						casesensitive="false" />
+	<if><isset property="libs.list" />
+		<then>
+			<for list="${libs.list}" param="lib.id">
+				<sequential>
+					<propertycopy override="yes" name="lib.name" from="dependency.lib.@{lib.id}" />
+					<!-- echo message="@{lib.id}" / -->
+					
+					<!-- check whether the value is empty. In this case the globally configured value is assigned to the property so that it is not blank anymore -->
+					<if><length string="${lib.name}" trim="true" when="equal" length="0" />	
+						<then>
+							<var name="dependency.lib.@{lib.id}" value="${default.lib.@{lib.id}}" />
+						</then>
+					</if>
+					<echo file="${path.gen.classpathfile}" append="true">libs/${dependency.lib.@{lib.id}}${line.separator}</echo>
+				</sequential>
+			</for>
+		</then>
+<!--
+		<else>
+			<echo file="${path.gen.classpathfile}" append="true"></echo>
+		</else>
+-->
+	</if>
+
+
+	<!-- build the name for the jar file -->
+	<var name="tmp" value="${projectname}" />
+	<if><isset property="jarbase" />
+		<then>
+			<var name="tmp" value="${jarbase}" />
+		</then>
+	</if> 
+
+	<!-- append verson number if it is not empty -->
+	<if><isset property="version" />
+		<then>
+			<if><and>
+					<length string="${version}" trim="true" when="greater" length="0" />	
+					<not>
+						<equals arg1="${version}" arg2="none" trim="true" />
+					</not>
+				</and>
+				<then>
+					<var name="tmp" value="${tmp}-${version}" />
+				</then>
+			</if>
+		</then>
+	</if>
+	<var name="file.jar" value="${path.gen}/${tmp}.jar" />
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_importManifest.xml b/SDT/schema4.0/etc/tasks/_importManifest.xml
new file mode 100644
index 0000000000000000000000000000000000000000..84097da891db3231afeb57446521dc25d37f2c1f
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_importManifest.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_importManifest" default="build">
+
+<!-- BAUSTELLE -->
+
+
+
+
+
+
+<!--	INTERNAL: _importManifest
+		Import the Manifest from another jar (in lib or from another project).
+-->
+<target name="_importManifest">
+	<!-- Build an external build file to add the content to the jar file -->
+	<echo file="${path.gen.importmanifestcmdfile}" append="true">&lt;project name="runimportmanifest" default="_runimportmanifest">${line.separator}</echo>
+	<echo file="${path.gen.importmanifestcmdfile}" append="true">&lt;target name="_runimportmanifest">${line.separator}</echo>
+	<propertyselector property="manifestlib" 
+						override="yes"
+						delimiter="," 
+						match="^importmanifest\.lib\.(.*)" 
+						select="\1"
+						casesensitive="false" />
+	<if><isset property="manifestlib" />
+	<then>
+		<echo file="${path.gen.importmanifestcmdfile}" append="true">&lt;zip destfile="${file.jar}" update="true">${line.separator}</echo>
+		<propertycopy name="fs.src" from="default.lib.${manifestlib}" override="yes" />
+		<var name="fs.src" value="${path.libs}/${fs.src}" />
+		<echo file="${path.gen.importmanifestcmdfile}" append="true">&lt;zipfileset src="${fs.src}" includes="META-INF/MANIFEST.MF" />${line.separator}</echo>	
+		<echo file="${path.gen.importmanifestcmdfile}" append="true">&lt;/zip>${line.separator}</echo>
+	</then>
+	</if>
+
+
+	<echo file="${path.gen.importmanifestcmdfile}" append="true">&lt;/target>${line.separator}</echo>
+	<echo file="${path.gen.importmanifestcmdfile}" append="true">&lt;/project>${line.separator}</echo>
+
+
+	<!-- run the generates build file -->
+	<ant antfile="${path.gen.importmanifestcmdfile}" target="_runimportmanifest" inheritAll="true" />
+
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_includeExternalResourcesInJar.xml b/SDT/schema4.0/etc/tasks/_includeExternalResourcesInJar.xml
new file mode 100644
index 0000000000000000000000000000000000000000..b03ab105d4fae133c4604c02c546f4f417a785b5
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_includeExternalResourcesInJar.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_includeExternalResourcesInJar" default="build">
+
+<!--	INTERNAL: _includeExternalResourcesInJar
+		Check, whether there should resources from other jar files be included.
+		Generate an external build file and execute it in order to add the files.
+-->
+<target name="_includeExternalResourcesInJar">
+	<!-- go through all properties that start with "include." -->
+	<propertyselector	property="include.list" 
+						override="yes"
+						delimiter="," 
+						match="^include\.(.*)" 
+						select="\1"
+						casesensitive="false" />
+	<if><isset property="include.list" />
+		<then>
+		
+			<!-- Build an external build file to add the content to the jar file -->
+			<echo file="${path.gen.includecmdfile}" append="true">&lt;project name="runzipinclude" default="_runzipinclude">${line.separator}</echo>
+			<echo file="${path.gen.includecmdfile}" append="true">&lt;target name="_runzipinclude">${line.separator}</echo>
+			<echo file="${path.gen.includecmdfile}" append="true">&lt;jar destfile="${file.jar}" update="true">${line.separator}</echo>
+			
+			<for list="${include.list}" param="include.id">
+			<sequential>
+				<propertycopy override="yes" name="include.value" from="include.@{include.id}" />
+				<var name="include.iszipfileset" value="true" />
+				
+
+				<!-- check whether the include is from a lib or generated project file -->
+				<if><matches string="include.@{include.id}" pattern="^include\.lib.\.*" />
+					<then>	<!-- lib -->
+						<propertyregex	property="include.libname" 
+										override="yes"
+										input="include.@{include.id}"
+										regexp="^include\.(.*)" 
+										select="\1"
+										casesensitive="false" />
+						<propertycopy name="fs.src" from="default.${include.libname}" override="yes" />
+						<var name="fs.src" value="${path.libs}/${fs.src}" />
+					</then>
+					<else>	
+
+						<!-- check whether the include is from a gen/resources directory -->
+						<if><matches string="include.@{include.id}" pattern="^include\.gen\.resources" />
+						<then>
+							<var name="fs.src" value="${path.gen}" />
+							<var name="include.iszipfileset" value="false" />
+						</then>
+						<else>
+						
+							<!-- include from a project -->
+							<propertyregex	property="include.libname" 
+											override="yes"
+											input="include.@{include.id}"
+											regexp="^include\.project\.(.*)" 
+											select="\1"
+											casesensitive="false" />
+
+							<path id="x">
+								<fileset dir="../../gen/projects/${include.libname}">
+									<include name="*.jar" />
+								</fileset>
+							</path>
+							<var name="fs.src" value="${toString:x}" />
+						</else>
+						</if>
+					</else>
+				</if>
+				
+				<if><length string="${include.value}" trim="true" when="equal" length="0" />	
+					<then>
+						<var name="fs.includes" value="**/*" />
+					</then>
+					<else>
+						<var name="fs.includes" value="${include.value}" />
+					</else>
+				</if>										
+
+
+				<if><equals arg1="${include.iszipfileset}" arg2="true"/>	
+				<then>
+					<echo file="${path.gen.includecmdfile}" append="true">&lt;zipfileset src="${fs.src}" includes="${fs.includes}" />${line.separator}</echo>	
+				</then>
+				<else>
+					<echo file="${path.gen.includecmdfile}" append="true">&lt;fileset dir="${fs.src}" includes="${fs.includes}" />${line.separator}</echo>	
+				</else>
+				</if>
+
+			</sequential>
+			</for>
+			
+			<echo file="${path.gen.includecmdfile}" append="true">&lt;/jar>${line.separator}</echo>
+			<echo file="${path.gen.includecmdfile}" append="true">&lt;/target>${line.separator}</echo>
+			<echo file="${path.gen.includecmdfile}" append="true">&lt;/project>${line.separator}</echo>
+
+	
+			<!-- run the generates build file -->
+			<ant antfile="${path.gen.includecmdfile}" target="_runzipinclude" inheritAll="true" />
+		</then>
+	</if>
+
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_prepare.xml b/SDT/schema4.0/etc/tasks/_prepare.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0658dffe73ee7c1cd0a61127db64d3c51dae9238
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_prepare.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_prepare" default="build">
+
+<!--	TASK: _prepare
+		Set properties, generate the classpath etc
+-->
+<target name="_prepare">
+	<!-- initialize the build.time property -->
+	<tstamp />		
+	<tstamp>
+		<format property="build.time" pattern="dd.MM.yyyy HH:mm:ss" />
+	</tstamp>
+
+	<!-- Retrieve the subversion property -->
+	<trycatch>
+		<try>
+			<svn>
+				<status path="${basedir}" revisionProperty="svn.revision" />
+			</svn>
+		</try>
+		<catch>
+			<property name="svn.revision" value="svn.revision.undefined" />
+			<echo>Cannot determine SVN revision. SVN not found?</echo>
+		</catch>
+	</trycatch>
+
+	<mkdir dir="${path.genbase}" />
+	<mkdir dir="${path.gen}" />
+	<mkdir dir="${path.gen.classes}" />
+	<mkdir dir="${path.gen.documentation}" />
+	<mkdir dir="${path.gen.etc}" />
+	<mkdir dir="${path.gen.docbase}" />
+	<mkdir dir="${path.gen.documentation}" />
+	<mkdir dir="${path.gen.collection}" />
+	<mkdir dir="${path.gen.domain}" />
+
+	<!-- remove old help files -->
+	<delete file="${path.gen.classpathfile}"/>
+	<delete file="${path.gen.includecmdfile}"/>
+	<delete file="${path.gen.importmanifestcmdfile}"/>
+
+	<runtarget target="_handleProjectProperties" />
+
+	
+	<!-- make the directory for the domain -->
+	<if>
+		<isset property="omain" />
+		<then>
+			<mkdir dir="${path.gen.domain}/${omain}" />
+		</then>
+	</if>
+
+	
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_preparebuild.xml b/SDT/schema4.0/etc/tasks/_preparebuild.xml
new file mode 100644
index 0000000000000000000000000000000000000000..3df6082e757a557c57d0f6745267406549845467
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_preparebuild.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_preparebuild" default="build">
+
+<!--	INTERNAL: _preparebuild
+		Does preparations that are only necessary in case of a build
+-->
+<target name="_preparebuild">
+	<runtarget target="_checkDependentProjects" />
+	<runtarget target="_addPrivateLibs" />
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/_setClassPath.xml b/SDT/schema4.0/etc/tasks/_setClassPath.xml
new file mode 100644
index 0000000000000000000000000000000000000000..bebe50b7a56ed333822a6048494eec68485c3c3f
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/_setClassPath.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="_setClassPath" default="build">
+
+<!--	INTERNAL: _setClassPath
+		Set the internal classpath for building the project by reading from the classpathfile, or empty.
+-->
+<target name="_setClassPath">
+	<!-- set the classpath from the file, only when the _classpathfile exists. Otherwise define an empty path element -->
+	<available property="available.classpathfile" file="${path.gen.classpathfile}" />
+	<if><isset property="available.classpathfile" />
+		<then>
+			<path id="id.libraries">
+				<!--fileset dir="${path.base}" includesfile="${path.gen.classpathfile}" excludes="**/*"/ -->
+				<fileset dir="${path.base}" includesfile="${path.gen.classpathfile}" />
+			</path>
+		</then>
+		<else>
+			<path id="id.libraries">
+			</path>
+		</else>
+	</if>
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/all.xml b/SDT/schema4.0/etc/tasks/all.xml
new file mode 100644
index 0000000000000000000000000000000000000000..1859e09fe7bcc18b5f7f726bfdddb056976c2958
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/all.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="all" default="build">
+
+<!--	TASK: all
+		Clean up, build and collect
+-->
+<target name="all">
+	<runtarget target="clean" />
+	<runtarget target="build" />
+	<runtarget target="collect" />
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/allforced.xml b/SDT/schema4.0/etc/tasks/allforced.xml
new file mode 100644
index 0000000000000000000000000000000000000000..32f73751b478cf800e7623f3bebee89c55f71a2c
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/allforced.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="allforced" default="build">
+
+<!--	TASK: allforced
+		Clean up, build and collect. 
+		Includes a forced update to all dependent projects
+-->
+<target name="allforced">
+	<var name="dependency.projects.forcebuild" value="" />
+	<runtarget target="all" />
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/build.xml b/SDT/schema4.0/etc/tasks/build.xml
new file mode 100644
index 0000000000000000000000000000000000000000..0b87b3e0bdbfa8cff9e3eb73f122f6d7734e6d65
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/build.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="build" default="build">
+
+<!--	TASK: build
+		Main target
+-->
+<target name="build">
+	<echo>----</echo>
+	<echo>Building project "${projectname}"</echo>
+	<!-- don't run the build if it is a global build and the project property "global.build.ignore" is set -->
+	<if><not>
+			<and>
+				<isset property="global.build" />
+				<isset property="global.build.ignore" />
+			</and>
+		</not>
+		<then>
+			<runtarget target="compile" />
+			<runtarget target="buildjar" />
+		</then>
+		<else>
+			<echo>+--------------------------------------------------------------------------------+</echo>
+			<echo>| PROJECT IS NOT BUILD. Global build, but "global.build.ignore" property is set. |</echo>
+			<echo>+--------------------------------------------------------------------------------+</echo>
+		</else>
+	</if>
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/buildjar.xml b/SDT/schema4.0/etc/tasks/buildjar.xml
new file mode 100644
index 0000000000000000000000000000000000000000..119545a2ba817a6dc1b8aaaa4dfbc544a4620536
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/buildjar.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="buildjar" default="build">
+
+
+<!--	TASK: buildjar
+		Build the jar file
+-->
+<target name="buildjar" depends="_getBuildNumber">
+
+	<!-- Build the base jar file -->
+	<if><not>
+			<equals arg1="${manifest}" arg2="none" trim="true" />
+		</not>
+		<then>
+			<jar destfile="${file.jar}" manifest="${manifest}" whenmanifestonly="create">
+				<fileset dir="${path.gen.classes}">
+					<include name="**/*.class" />
+				</fileset>
+				<manifest>
+					<!-- Who is building this jar? -->
+					<attribute name="Built-By" value="${user.name}"/>
+					<attribute name="Build-Time" value="${build.time}"/>
+					<attribute name="SVN-Revision" value="${svn.revision}"/>
+				</manifest>
+			</jar>
+		</then>
+		<else>
+			<jar destfile="${file.jar}" whenmanifestonly="create">
+				<fileset dir="${path.gen.classes}">
+					<include name="**/*.class" />
+				</fileset>
+				<manifest>
+					<!-- Who is building this jar? -->
+					<attribute name="Built-By" value="${user.name}"/>
+					<attribute name="Build-Time" value="${build.time}"/>
+					<attribute name="SVN-Revision" value="${svn.revision}"/>
+				</manifest>
+			</jar>
+		</else>
+	</if>
+
+	<!-- Add resources, if necessary -->
+	<available property="available.resources" file="resources" />
+	<if><isset property="available.resources" />
+		<then>
+			<jar destfile="${file.jar}" update="true">
+				<fileset dir="${path.resources}">
+					<include name="**/*" />
+				</fileset>
+			</jar>
+		</then>
+	</if>
+	
+	<!-- Include external resources in the jar file -->
+	<runtarget target="_includeExternalResourcesInJar" />
+
+	<!-- Include external manifest in the jar file -->
+	<!-- <runtarget target="_importManifest" /> -->
+
+</target>
+
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/clean.xml b/SDT/schema4.0/etc/tasks/clean.xml
new file mode 100644
index 0000000000000000000000000000000000000000..8d86e0be8f13e14fc9914ad1b67562a383fd0e62
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/clean.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="clean" default="build">
+
+<!--	TASK: Clean
+		Removes all generated files from the "gen" directory for a project
+-->
+<target name="clean" depends="_cleanDependentProjects">
+	<echo>Cleaning project "${projectname}"</echo>
+	<delete dir="${path.gen}"/>
+	<delete dir="${path.gen.documentation}"/>
+
+	<!-- remove the directory for the domain -->
+	<if>
+		<isset property="omain" />
+		<then>
+			<delete dir="${path.gen.domain}/${omain}" />
+		</then>
+	</if>
+
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/collect.xml b/SDT/schema4.0/etc/tasks/collect.xml
new file mode 100644
index 0000000000000000000000000000000000000000..f34e547012a667cd0d9d1472ff2280bca44e92c9
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/collect.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="collect" default="build">
+
+<!--	TASK: collect
+		collect the results in a common directory. If $omain is set, the artifacts are also collected in
+		the specified Domain directory.
+-->
+<target name="collect" depends="_prepare">
+	<echo>Collecting artifacts from "${projectname}"</echo>
+	<if>
+		<isset property="omain" />
+		<then>
+			<copy todir="${path.gen.domain}/${omain}">
+				<fileset dir="${path.gen}" includes="*.jar"/>
+			</copy>
+		</then>
+	</if>
+	<copy todir="${path.gen.collection}">
+		<fileset dir="${path.gen}" includes="*.jar"/>
+	</copy>
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/compile.xml b/SDT/schema4.0/etc/tasks/compile.xml
new file mode 100644
index 0000000000000000000000000000000000000000..74f5382884758226bba2dfd809dbecf4dab40b3b
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/compile.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="compile" default="build">
+
+<!--	TASK: compile
+		Compile the source code
+-->
+<target name="compile" depends="_prepare,_preparebuild,_setClassPath">
+
+	<echo>Java.source=${java.source}, Java.target=${java.target}</echo>
+
+	<if><equals arg1="${uselint}" arg2="true" trim="true" />
+
+		<!-- Enable -Xlint compiler warnings -->
+		<then>
+			<javac 	destdir="${path.gen.classes}"
+					includes="**/*.java"
+					classpathref="id.libraries"
+					srcdir="${path.src}"
+					debug="on"
+					target="${java.target}"
+					source="${java.source}"
+					includeantruntime="false"
+					listfiles="on">
+				<compilerarg value="-Xlint"/>
+			</javac>
+		</then>
+
+		<!-- No special compiler warnings -->
+		<else>
+			<javac 	destdir="${path.gen.classes}"
+					includes="**/*.java"
+					classpathref="id.libraries"
+					srcdir="${path.src}"
+					debug="on"
+					target="${java.target}"
+					source="${java.source}"
+					includeantruntime="false"
+					listfiles="on">
+			</javac>
+		</else>
+	</if>
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/compilenative.xml b/SDT/schema4.0/etc/tasks/compilenative.xml
new file mode 100644
index 0000000000000000000000000000000000000000..8ad51f72712afe00f61c900bfc288d368533eca2
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/compilenative.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="compilenative" default="build">
+
+<!--
+	Compile native code
+-->
+<target name="compilenative" depends="_prepare, _buildNative">
+</target>
+
+</project>
diff --git a/SDT/schema4.0/etc/tasks/doc.xml b/SDT/schema4.0/etc/tasks/doc.xml
new file mode 100644
index 0000000000000000000000000000000000000000..add2e25f7a066fafdcd73de61647bfbe6a796b09
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/doc.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="doc" default="build">
+
+<!--	TASK: doc
+		Generate documentation for a project
+-->
+
+<target name="doc" depends="_prepare,_setClassPath">
+	<javadoc 	destdir="${path.gen.documentation}"
+				classpathref="id.libraries"
+				sourcepath="${path.src}"
+				>
+	</javadoc>
+</target>
+
+</project>
+
diff --git a/SDT/schema4.0/etc/tasks/eclipse.xml b/SDT/schema4.0/etc/tasks/eclipse.xml
new file mode 100644
index 0000000000000000000000000000000000000000..bbab65e89cbbc2326cbe46aeb7afb379d52e7560
--- /dev/null
+++ b/SDT/schema4.0/etc/tasks/eclipse.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8" ?> 
+<project name="eclipse" default="build">
+
+<!--	TASK: eclipse
+		Set properties, generate the classpath etc
+-->
+<target name="eclipse" depends="build, _setClassPath">
+
+	<!-- Writing the .classpath file -->
+	<!-- using echoxml is not possible together with the "for" statement, so <echo> and escapes must be used -->
+	<echo file="${path.eclipse.classpathfile}">&lt;?xml version="1.0" encoding="UTF-8"?&gt;${line.separator}&lt;classpath&gt;${line.separator}&lt;classpathentry kind="src" path="src"/&gt;${line.separator}&lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/&gt;${line.separator}</echo>
+	<for param="p">
+		<path refid="id.libraries" />
+		<sequential>
+			<echo file="${path.eclipse.classpathfile}" append="true">&lt;classpathentry kind="lib" path="@{p}"/&gt;${line.separator}</echo>
+		</sequential>
+	</for>
+	<echo file="${path.eclipse.classpathfile}" append="true">&lt;classpathentry kind="output" path="classes"/&gt;${line.separator}&lt;/classpath&gt;${line.separator}</echo>
+
+	<!-- Writing the .project file -->
+	<echoxml file="${path.eclipse.projectfile}">
+		<projectDescription>
+			<name>${projectname}</name>
+			<comment></comment>
+			<projects></projects>
+			<buildSpec>
+				<buildCommand>
+					<name>org.eclipse.jdt.core.javabuilder</name>
+					<arguments>
+					</arguments>
+				</buildCommand>
+			</buildSpec>
+			<natures>
+				<nature>org.eclipse.jdt.core.javanature</nature>
+			</natures>
+			<linkedResources>
+				<link>
+					<name>classes</name>
+					<type>2</type>
+					<location>${path.gen.classes}</location>
+				</link>
+			</linkedResources>
+		</projectDescription>
+	</echoxml> 
+
+	<!-- Writing the settings/org.eclipse.jdt.core.prefs file -->
+	<mkdir dir="${path.eclipse.settingsdir}" />
+	<echo file="${path.eclipse.settingsfile}">org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled${line.separator}</echo>
+	<echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.codegen.targetPlatform=${java.target}${line.separator}</echo>
+	<echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve${line.separator}</echo>
+	<echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.compliance=${java.source}${line.separator}</echo>
+	<echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.debug.lineNumber=generate${line.separator}</echo>
+	<echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.debug.localVariable=generate${line.separator}</echo>
+	<echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.debug.sourceFile=generate${line.separator}</echo>
+	<echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning${line.separator}</echo>
+	<echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning${line.separator}</echo>
+	<echo file="${path.eclipse.settingsfile}" append="true">org.eclipse.jdt.core.compiler.source=${java.source}${line.separator}</echo>
+
+
+</target>
+
+</project>
+
+
diff --git a/SDT/schema4.0/gen/html/EchonetLiteExamples.html b/SDT/schema4.0/gen/html/EchonetLiteExamples.html
new file mode 100644
index 0000000000000000000000000000000000000000..34817ab33135df3c7897cb665788176a12298733
--- /dev/null
+++ b/SDT/schema4.0/gen/html/EchonetLiteExamples.html
@@ -0,0 +1,161 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+  
+
+	
+		
+			
+				
+					This property indicates the ON/OFF status.
+					
+						
+					
+				
+			
+		
+
+  	
+
+		
+			
+				
+					This property indicates the installation location
+					
+						
+					
+				
+			
+			
+				
+					
+				
+			
+		
+
+  	
+
+		
+			
+				
+					This property indicates the instantaneous power consumption of the device in watts.
+					
+						
+					
+				
+			
+		
+
+		
+			
+				
+					This property indicates the measured temperature value in units of 0.1C.
+					
+						
+					
+				
+			
+		
+	
+	
+
+  
+
+	
+		
+			
+				
+					
+				
+				
+					
+				
+			
+
+			
+				
+				
+
+				
+					
+				
+
+				
+					
+				
+
+				
+					
+				
+
+
+				
+
+				
+					
+
+					
+
+					
+						
+							
+						
+					
+
+				
+
+
+				
+
+				
+					
+						
+							This property indicates whether the door/cover is open or closed.
+							
+								
+							
+						
+						
+							Washing machine setting
+							
+								
+							
+						
+						
+							This property indicates the current stage of the washing cycle.
+							
+								
+							
+						
+						
+							This property indicates the time remaining to complete the current washing cycle in the HH:MM:SS format.
+							
+								
+							
+						
+
+						
+
+						
+							Reservation ON/OFF
+							
+								
+							
+						
+						
+							Timer value (HH:MM)
+							
+								
+							
+						
+						
+							Timer value (HH:MM)
+							
+								
+							
+						
+						
+					
+				
+			
+		
+	
diff --git a/SDT/schema4.0/gen/html/com.telekom/index.html b/SDT/schema4.0/gen/html/com.telekom/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..3a35cfa4f717c342ca2c45cc41563201c954bbcf
--- /dev/null
+++ b/SDT/schema4.0/gen/html/com.telekom/index.html
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="ISO-8859-1"?><html xmlns:dal="http://hgi.org/xml/dal/1.0" xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Domain com.telekom</title>
+</head>
+<body>
+<h1>Domain com.telekom</h1>
+<h2>Devices</h2>
+<ul>
+<li>
+<a href="switch.power.html">PowerSwitch</a>
+</li>
+</ul>
+</body>
+</html>
diff --git a/SDT/schema4.0/gen/html/com.telekom/switch.power.html b/SDT/schema4.0/gen/html/com.telekom/switch.power.html
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/SDT/schema4.0/gen/html/dal-core.html b/SDT/schema4.0/gen/html/dal-core.html
new file mode 100644
index 0000000000000000000000000000000000000000..4a9f90e5ad3f7a74a67a05f9d667d5fb6c02c1bb
--- /dev/null
+++ b/SDT/schema4.0/gen/html/dal-core.html
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+  
+    
+      
+	BooleanState is the preferred module for modelling a
+	functionality corresponding to an underlying binary state. This
+	module should be used to abstract away from the actual datatype
+	and values in question. Note that the module does not define whether
+	the execution mode is blocking or non-blocking.
+      
+      
+	
+	  
+	    Obtain the current associated state.
+	  
+	
+	
+	  
+	    Set the associated state to the specified value.
+	  
+	  
+	    
+	      The desired value of the associated state.
+	    
+	  
+	
+      
+    
+  
+
diff --git a/SDT/schema4.0/gen/html/dal-eg.html b/SDT/schema4.0/gen/html/dal-eg.html
new file mode 100644
index 0000000000000000000000000000000000000000..426e7f5102f39ed0484ca11175985e69428e216f
--- /dev/null
+++ b/SDT/schema4.0/gen/html/dal-eg.html
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+  
+    
+  
+
+  
+  
+
+  
+
+    
+      
+	PowerSwitch
+	
+	Telekom Innovation Laboratories
+      
+      
+      
+	This device is intended as a demonstration of how to use the
+	abstract modules defined in the HGI Core domain. The
+	vendor has provided a proprietry module with two operations
+	on and off. This is clearly a candidate for the 
+	module class BooleanState.
+      
+
+      
+	
+	  
+	    The proprietry interface for turning the switch on and off. 
+	    Actions for setting the state to on or off 
+	    and for querying the state.
+	  
+
+	  
+	    
+	      
+		Turn the switch on.
+	      
+	    
+	    
+	      
+		Turn the switch off.
+	      
+	    
+	    
+	      
+		Query the state of the switch. Returns the string "on"
+		or "off".
+	      
+	    
+	  
+
+	  
+	  	
+		  
+		    
+	 		
+		  
+		  An event that indicates the new state of the switch.
+		  
+	  	
+	  
+	
+
+	
+	  
+	
+      
+    
+  
diff --git a/SDT/schema4.0/gen/html/example1.SDT.html b/SDT/schema4.0/gen/html/example1.SDT.html
new file mode 100644
index 0000000000000000000000000000000000000000..6d56d3a0164cc6796a69e32edfe965e22169bfea
--- /dev/null
+++ b/SDT/schema4.0/gen/html/example1.SDT.html
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+	
+
+		
+		
+			
+				
+					This property sets the ON/OFF status.
+						
+							 
+						
+				
+			
+			
+				
+				
+			
+		
+
+
+		
+			
+				
+					This property indicates the installation location
+					
+						
+					
+				
+			
+			
+				 
+			
+		
+
+		
+			
+				
+					This indicates cumulative power consumption of the device in increments of 0.001kWh.
+					
+						
+					
+				
+			
+		
+
+		
+			
+				
+					Timer value (HH:MM)
+					
+						
+					
+				
+			
+		
+
+		
+			
+				
+					This reads the open=true or closed=false status of a door 
+					
+						
+					
+				
+			
+		
+
+	
+
diff --git a/SDT/schema4.0/gen/html/example2.SDT.html b/SDT/schema4.0/gen/html/example2.SDT.html
new file mode 100644
index 0000000000000000000000000000000000000000..b7999204ca9ac6c8a63d3616d48218ffaafe25ce
--- /dev/null
+++ b/SDT/schema4.0/gen/html/example2.SDT.html
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+    
+        
+    
+
+	
+		
+			
+				
+					
+				
+				
+					
+				
+				
+					
+				
+				
+					
+				
+				
+					
+				
+			
+		
+	
diff --git a/SDT/schema4.0/gen/html/example3.SDT.html b/SDT/schema4.0/gen/html/example3.SDT.html
new file mode 100644
index 0000000000000000000000000000000000000000..a81f5d635b760c74f447bf33f2298b0fc6b9e81d
--- /dev/null
+++ b/SDT/schema4.0/gen/html/example3.SDT.html
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+    
+        
+    
+
+	
+		
+			
+				
+					
+				
+				
+					
+				
+				
+					
+				
+				
+					
+				
+				
+					
+				
+				
+					
+				
+			
+		
+	
diff --git a/SDT/schema4.0/gen/html/hgi.dal.core/index.html b/SDT/schema4.0/gen/html/hgi.dal.core/index.html
new file mode 100644
index 0000000000000000000000000000000000000000..3e17706cbd1a2f88dc09494b21515a4e623606e7
--- /dev/null
+++ b/SDT/schema4.0/gen/html/hgi.dal.core/index.html
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="ISO-8859-1"?><html xmlns:dal="http://homegatewayinitiative.org/xml/dal/2.0" xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Domain hgi.dal.core</title>
+</head>
+<body>
+<h1>Domain hgi.dal.core</h1>
+<h2>Devices</h2>
+<ul/>
+</body>
+</html>
diff --git a/SDT/schema4.0/gen/html/mseeb.html b/SDT/schema4.0/gen/html/mseeb.html
new file mode 100644
index 0000000000000000000000000000000000000000..0e01ea6f8d9816e8d4114ea9de2759619a54eebe
--- /dev/null
+++ b/SDT/schema4.0/gen/html/mseeb.html
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+
+
+    
+        
+    
+
+    
+        
+            
+                BooleanState is the preferred module for modelling a functionality corresponding to an underlying binary state.This module should be used to abstract away from the actual datatype and values in question. Note that the module does not define whether the execution mode is blocking or non-blocking.
+            
+            
+                
+                    
+                        Obtain the current associated state.
+                    
+                
+                
+                    
+                        Set the associated state to the specified value.
+                    
+                    
+                        
+                        The desired value of the associated state.
+                        
+                    
+                
+          
+          
+                
+                    
+                        
+                        
+                    
+                      
+          
+        
+    
+
+
+
+    
+
+
+
+        
+            
+                Multi Socket Electrical-Extension-Block
+                HGI
+                1.0
+                http://www.homegatewayinitative.org
+                1234.5
+            
+            
+                This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
+            
+
+
+
+            
+                
+                    
+                    
+                        The proprietry interface for turning all switches of the extension block on and off. 
+                        The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false".
+                    
+                
+
+                
+                    
+                        
+                            
+                                This datapoint represents the firmware version of the extension block.
+                            
+                        
+                        
+                        
+                            
+                                This datapoint is an array of strings with the names of the contained devices.
+                            
+                        
+                    
+                
+            
+
+
+
+            
+
+
+
+                
+                    
+                        PowerSwitch 1
+                        HGI
+                    
+                    
+                        This sub device is intended as a demonstration of how to use the abstract modules defined in the HGI Core domain.
+                    
+                    
+                        
+                            
+                        
+                    
+                
+
+
+
+                
+                    
+                        PowerSwitch 2
+                        HGI
+                    
+                    
+                        This sub device is intended as a demonstration of how to use the abstract modules defined in the HGI Core domain.
+                    
+                    
+                        
+                            
+                        
+                    
+                
+
+            
+
+        
+    
diff --git a/SDT/schema4.0/lib/ant/ant-contrib-1.0b3.jar b/SDT/schema4.0/lib/ant/ant-contrib-1.0b3.jar
new file mode 100644
index 0000000000000000000000000000000000000000..062537661a514c2ce97d18948f4f25f7226cc1a0
Binary files /dev/null and b/SDT/schema4.0/lib/ant/ant-contrib-1.0b3.jar differ
diff --git a/SDT/schema4.0/lib/ant/antSetLogLevel.jar b/SDT/schema4.0/lib/ant/antSetLogLevel.jar
new file mode 100644
index 0000000000000000000000000000000000000000..59e6a22d692662b8a19139ae484aac6dacecde9c
Binary files /dev/null and b/SDT/schema4.0/lib/ant/antSetLogLevel.jar differ
diff --git a/SDT/schema4.0/lib/trang.jar b/SDT/schema4.0/lib/trang.jar
new file mode 100644
index 0000000000000000000000000000000000000000..b3d3de14794b34d79af3523bf56a2cb40f7e07ee
Binary files /dev/null and b/SDT/schema4.0/lib/trang.jar differ
diff --git a/SDT/schema4.0/properties b/SDT/schema4.0/properties
new file mode 100644
index 0000000000000000000000000000000000000000..9ecd260ab42950151f29291dfd8899d621604c97
--- /dev/null
+++ b/SDT/schema4.0/properties
@@ -0,0 +1 @@
+loglevel=debug
diff --git a/SDT/schema4.0/src/domain.rng b/SDT/schema4.0/src/domain.rng
new file mode 100644
index 0000000000000000000000000000000000000000..b35d73094c626c542ae46af4f4d0dd29963e7d06
--- /dev/null
+++ b/SDT/schema4.0/src/domain.rng
@@ -0,0 +1,386 @@
+<!--
+   - domain.rng
+   -
+   - Version 4.0
+   -
+   - This work is released by the MAS Working Group of oneM2M, December 2018.
+   - The work is created and released under the 3-Clause BSD License.
+   - See the license text at [https://opensource.org/licenses/BSD-3-Clause for
+   - full details.
+   -->
+
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+	datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ 
+
+	<start>
+		<ref name="Domain"/>
+	</start>
+
+
+	<define name="Domain">
+		<element name="Domain">
+			<optional>
+				<attribute name="xml:base">
+					<data type="anyURI"/>
+				</attribute>
+			</optional>
+			<attribute name="id">
+				<data type="ID"/>
+			</attribute>
+			<ref name="DocDef"/>
+			<optional>
+				<element name="Imports">
+					<oneOrMore>
+						<ref name="Domain"/>
+					</oneOrMore>
+				</element>
+			</optional>
+			<optional>
+				<element name="Modules">
+					<oneOrMore>
+						<element name="ModuleClass">
+							<ref name="ModuleDef"/>
+						</element>
+					</oneOrMore>
+				</element>
+			</optional>
+			<optional>
+				<element name="Devices">
+					<oneOrMore>
+						<element name="Device">
+							<attribute name="id">
+								<data type="Name"/>
+							</attribute>
+							<ref name="DocDef"/>
+							<optional>
+								<ref name="PropertiesDef"/>
+							</optional>
+							<optional>
+								<ref name="Modules"/>
+							</optional>
+							<optional>
+								<element name="SubDevices">
+									<oneOrMore>
+										<element name="SubDevice">
+											<attribute name="id">
+												<data type="Name"/>
+											</attribute>
+											<ref name="DocDef"/>
+											<optional>
+												<ref name="PropertiesDef"/>
+											</optional>
+											<optional>
+												<ref name="Modules"/>
+											</optional>
+										</element>
+									</oneOrMore>
+								</element>
+							</optional>
+						</element>
+					</oneOrMore>
+				</element>
+			</optional>
+		</element>
+	</define>
+
+
+	<define name="PropertiesDef">
+		<element name="Properties">
+			<oneOrMore>
+				<element name="Property">
+					<attribute name="name">
+						<text/>
+					</attribute>
+					<optional>
+						<attribute name="optional">
+							<data type="boolean"/>
+						</attribute>
+					</optional>
+					<optional>
+						<attribute name="value">
+							<text/>
+						</attribute>
+					</optional>
+					<ref name="DocDef"/>
+					<ref name="SimpleType" />
+				</element>
+			</oneOrMore>
+		</element>
+	</define>
+
+
+	<define name="DataTypeDef">
+		<element name="DataType">
+			<optional>
+				<attribute name="name">
+					<text/>
+				</attribute>
+			</optional>
+			<optional>
+				<attribute name="unitOfMeasure">
+					<text/>
+				</attribute>
+			</optional>
+			<ref name="DocDef"/>
+			<choice>
+				<ref name="StructType" />
+				<ref name="ArrayType" />
+				<ref name="SimpleType" />
+			</choice>
+			<optional>
+				<ref name="ConstraintsDef"/>
+			</optional>
+		</element>
+	</define>
+
+
+	<define name="StructType">
+		<element name="Struct">
+			<oneOrMore>
+				<ref name="DataTypeDef" />
+			</oneOrMore>
+		</element>
+	</define>
+
+
+	<define name="ArrayType">
+		<element name="Array">
+			<ref name="DataTypeDef" />
+		</element>
+	</define>
+
+
+	<define name="SimpleType">
+		<element name="SimpleType">
+			<attribute name="type">
+				<ref name="BasicType" />
+			</attribute>
+		</element>
+	</define>
+
+
+	<define name="BasicType">
+		<choice>
+			<value>integer</value>
+			<value>boolean</value>
+			<value>string</value>
+			<value>byte</value>
+			<value>float</value>
+			<value>array</value>
+			<value>enum</value>
+			<value>date</value>
+			<value>time</value>
+			<value>datetime</value>
+			<value>blob</value>
+			<value>uri</value>
+		</choice>
+	</define>
+
+
+	<define name="ConstraintsDef">
+		<element name="Constraints">
+			<oneOrMore>
+				<element name="Constraint">
+					<attribute name="name">
+						<text/>
+					</attribute>
+					<optional>
+						<attribute name="type">
+							<ref name="BasicType" />
+						</attribute>
+					</optional>
+					<optional>
+						<attribute name="value">
+							<text/>
+						</attribute>
+					</optional>
+					<ref name="DocDef"/>
+				</element>
+			</oneOrMore>
+		</element>
+	</define>
+
+	<define name="DocText">
+		<zeroOrMore>
+			<choice>
+				<text/>
+				<element name="em">
+					<text/>
+				</element>
+				<element name="b">
+					<text/>
+				</element>
+				<element name="tt">
+					<text/>
+				</element>
+			</choice>
+		</zeroOrMore>
+	</define>
+
+
+	<!-- <Doc> element is always optional -->
+	<define name="DocDef">
+		<optional>
+			<element name="Doc">
+				<choice>
+					<ref name="DocText"/>
+					<zeroOrMore>
+						<choice>
+							<element name="p">
+								<ref name="DocText"/>
+							</element>
+							<element name="img">
+								<attribute name="src"/>
+								<element name="caption">
+									<text/>
+								</element>
+							</element>
+						</choice>
+					</zeroOrMore>
+				</choice>
+			</element>
+		</optional>
+	</define>
+
+
+	<define name="ModuleDef">
+		<attribute name="name">
+			<text/>
+		</attribute>
+		<optional>
+			<attribute name="optional">
+				<data type="boolean"/>
+			</attribute>
+		</optional>
+		<optional>
+			<element name="extends">
+				<attribute name="domain">
+					<data type="IDREF"/>
+				</attribute>
+				<attribute name="class"/>
+			</element>
+		</optional>
+		<ref name="DocDef"/>
+		<optional>
+			<ref name="PropertiesDef"/>
+		</optional>
+		<optional>
+			<ref name="Actions"/>
+		</optional>
+		<optional>
+			<ref name="Data"/>
+		</optional>
+		<optional>
+			<ref name="Events"/>
+		</optional>
+	</define>
+
+
+	<define name="Modules">
+		<element name="Modules">
+			<oneOrMore>
+				<element name="Module">
+					<ref name="ModuleDef"/>
+				</element>
+			</oneOrMore>
+		</element>
+	</define>
+
+
+	<define name="Actions">
+		<element name="Actions">
+			<oneOrMore>
+				<element name="Action">
+					<attribute name="name">
+						<text/>
+					</attribute>
+					<optional>
+						<attribute name="optional">
+							<data type="boolean"/>
+						</attribute>
+					</optional>
+					<ref name="DocDef"/>
+					<optional>
+						<ref name="DataTypeDef"/>
+					</optional>
+					<optional>
+						<ref name="ArgDef" />
+					</optional>
+				</element>
+			</oneOrMore>
+		</element>
+	</define>
+
+
+	<define name="ArgDef">
+		<element name="Args">
+			<oneOrMore>
+				<element name="Arg">
+					<attribute name="name"/>
+					<ref name="DocDef"/>
+					<ref name="DataTypeDef"/>
+				</element>
+			</oneOrMore>
+		</element>
+	</define>
+
+
+	<define name="Data">
+		<element name="Data">
+			<oneOrMore>
+				<element name="DataPoint">
+					<attribute name="name">
+						<text/>
+					</attribute>
+					<optional>
+						<attribute name="optional">
+							<data type="boolean"/>
+						</attribute>
+					</optional>
+					<optional>
+						<attribute name="writable">
+							<data type="boolean"/>
+						</attribute>
+					</optional>
+					<optional>
+						<attribute name="readable">
+							<data type="boolean"/>
+						</attribute>
+					</optional>
+					<optional>
+						<attribute name="eventable">
+							<data type="boolean"/>
+						</attribute>
+					</optional>
+					<ref name="DocDef"/>
+					<ref name="DataTypeDef"/>
+				</element>
+			</oneOrMore>
+		</element>
+	</define>
+
+
+	<define name="Events">
+		<element name="Events">
+			<oneOrMore>
+				<element name="Event">
+					<attribute name="name">
+						<text/>
+					</attribute>
+					<optional>
+						<attribute name="optional">
+							<data type="boolean"/>
+						</attribute>
+					</optional>
+					<ref name="DocDef"/>
+					<optional>
+						<ref name="Data" />
+					</optional>
+				</element>
+			</oneOrMore>
+		</element>
+	</define>
+
+</grammar>
+
diff --git a/SDT/schema4.0/src/domain.xsd b/SDT/schema4.0/src/domain.xsd
new file mode 100644
index 0000000000000000000000000000000000000000..1071587ba52303129f853c45257b1fef7a7576e0
--- /dev/null
+++ b/SDT/schema4.0/src/domain.xsd
@@ -0,0 +1,302 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  - domain.rng
+  -
+  - Version 4.0
+  -
+  - This work is released by the MAS Working Group of oneM2M, December 2018.
+  - The work is created and released under the 3-Clause BSD License.
+  - See the license text at [https://opensource.org/licenses/BSD-3-Clause for
+  - full details.
+-->
+<xs:schema targetNamespace="http://homegatewayinitiative.org/xml/dal/3.0" 
+	   xmlns="http://homegatewayinitiative.org/xml/dal/3.0" 
+	   xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+	  
+ elementFormDefault="qualified">
+  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
+  <xs:element name="Domain">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="DocDef"/>
+        <xs:element minOccurs="0" ref="Imports"/>
+        <xs:element minOccurs="0" name="Modules">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="ModuleClass"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element minOccurs="0" ref="Devices"/>
+      </xs:sequence>
+      <xs:attribute ref="xml:base"/>
+      <xs:attribute name="id" use="required" type="xs:ID"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Imports">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Domain"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ModuleClass" type="ModuleDef"/>
+  <xs:element name="Devices">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Device"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Device">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="DocDef"/>
+        <xs:element minOccurs="0" ref="Properties"/>
+        <xs:element minOccurs="0" ref="Modules"/>
+        <xs:element minOccurs="0" ref="SubDevices"/>
+      </xs:sequence>
+      <xs:attribute name="id" use="required" type="xs:Name"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="SubDevices">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="SubDevice"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="SubDevice">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="DocDef"/>
+        <xs:element minOccurs="0" ref="Properties"/>
+        <xs:element minOccurs="0" ref="Modules"/>
+      </xs:sequence>
+      <xs:attribute name="id" use="required" type="xs:Name"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Properties">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Property"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Property">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="DocDef"/>
+        <xs:element ref="SimpleType"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="optional" type="xs:boolean"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="DataType">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="DocDef"/>
+        <xs:choice>
+          <xs:element ref="Struct"/>
+          <xs:element ref="Array"/>
+          <xs:element ref="SimpleType"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="Constraints"/>
+      </xs:sequence>
+      <xs:attribute name="name"/>
+      <xs:attribute name="unitOfMeasure"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Struct">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="DataType"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Array">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="DataType"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="SimpleType">
+    <xs:complexType>
+      <xs:attribute name="type" use="required" type="BasicType"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:simpleType name="BasicType">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="integer"/>
+      <xs:enumeration value="boolean"/>
+      <xs:enumeration value="string"/>
+      <xs:enumeration value="byte"/>
+      <xs:enumeration value="float"/>
+      <xs:enumeration value="array"/>
+      <xs:enumeration value="enum"/>
+      <xs:enumeration value="date"/>
+      <xs:enumeration value="time"/>
+      <xs:enumeration value="datetime"/>
+      <xs:enumeration value="blob"/>
+      <xs:enumeration value="uri"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:element name="Constraints">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Constraint"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Constraint">
+    <xs:complexType>
+      <xs:group ref="DocDef"/>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="type" type="BasicType"/>
+      <xs:attribute name="value"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:group name="DocText">
+    <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="em"/>
+        <xs:element ref="b"/>
+        <xs:element ref="tt"/>
+      </xs:choice>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="em" type="xs:string"/>
+  <xs:element name="b" type="xs:string"/>
+  <xs:element name="tt" type="xs:string"/>
+  <!-- <Doc> element is always optional -->
+  <xs:group name="DocDef">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="Doc"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="Doc">
+    <xs:complexType mixed="true">
+      <xs:choice>
+        <xs:group ref="DocText"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="p"/>
+          <xs:element ref="img"/>
+        </xs:choice>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="p">
+    <xs:complexType mixed="true">
+      <xs:group ref="DocText"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="img">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="caption"/>
+      </xs:sequence>
+      <xs:attribute name="src" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="caption" type="xs:string"/>
+  <xs:complexType name="ModuleDef">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="extends"/>
+      <xs:group ref="DocDef"/>
+      <xs:element minOccurs="0" ref="Properties"/>
+      <xs:element minOccurs="0" ref="Actions"/>
+      <xs:element minOccurs="0" ref="Data"/>
+      <xs:element minOccurs="0" ref="Events"/>
+    </xs:sequence>
+    <xs:attribute name="name" use="required"/>
+    <xs:attribute name="optional" type="xs:boolean"/>
+  </xs:complexType>
+  <xs:element name="extends">
+    <xs:complexType>
+      <xs:attribute name="domain" use="required" type="xs:IDREF"/>
+      <xs:attribute name="class" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Modules">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Module"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Module" type="ModuleDef"/>
+  <xs:element name="Actions">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Action"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Action">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="DocDef"/>
+        <xs:element minOccurs="0" ref="DataType"/>
+        <xs:element minOccurs="0" ref="Args"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="optional" type="xs:boolean"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Args">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Arg"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Arg">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="DocDef"/>
+        <xs:element ref="DataType"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Data">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="DataPoint"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="DataPoint">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="DocDef"/>
+        <xs:element ref="DataType"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="optional" type="xs:boolean"/>
+      <xs:attribute name="writable" type="xs:boolean"/>
+      <xs:attribute name="readable" type="xs:boolean"/>
+      <xs:attribute name="eventable" type="xs:boolean"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Events">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="Event"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="Event">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="DocDef"/>
+        <xs:element minOccurs="0" ref="Data"/>
+      </xs:sequence>
+      <xs:attribute name="name" use="required"/>
+      <xs:attribute name="optional" type="xs:boolean"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
diff --git a/SDT/schema4.0/src/xml.xsd b/SDT/schema4.0/src/xml.xsd
new file mode 100644
index 0000000000000000000000000000000000000000..d60043f94c9aba9e189a37fcb30ebdfe83ccd71b
--- /dev/null
+++ b/SDT/schema4.0/src/xml.xsd
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/XML/1998/namespace">
+  <xs:import schemaLocation="domain.xsd"/>
+  <xs:attribute name="base" type="xs:anyURI"/>
+</xs:schema>
diff --git a/SDT/schema4.0/style/html.xsl b/SDT/schema4.0/style/html.xsl
new file mode 100644
index 0000000000000000000000000000000000000000..8492bede0498eaebf0ce370eebb95cee9af73311
--- /dev/null
+++ b/SDT/schema4.0/style/html.xsl
@@ -0,0 +1,269 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<!-- - Name Spaces - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+<!--                                                                         -->
+<!--   Explicit namespace declaration for the DAL schema required, 
+       otherwise select expressions like '/Domain' don't work. An
+       alternative is to remove the declaration from the input XML
+       document ... -->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+		xmlns:dal="http://homegatewayinitiative.org/xml/dal/2.0"
+		xmlns="http://www.w3.org/1999/xhtml"
+		
+		xmlns:redirect="http://xml.apache.org/xalan/redirect" 
+		extension-element-prefixes="redirect"
+		version="1.0">
+
+  <xsl:output method="xml" indent="yes"  encoding="ISO-8859-1"/>
+
+  <xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
+
+  <!-- HTML Output - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                       -->
+  <!-- Create a directory for the domain id with an HTML page for each       -->
+  <!-- in the page. An index page contains links to all the devices.         -->
+  <!--                                                                       -->
+  <!-- Template param: destdir - directories will be created here            -->
+
+  <xsl:param name="destdir"/>
+
+  <xsl:template match="/dal:Domain">
+    <xsl:variable name="domain" select="@id"/>
+    <xsl:variable name="dir" select="concat($destdir,'/',$domain)"/>
+    <xsl:choose>
+      <xsl:when test="contains($vendor, 'SAXON 6.2')"/>
+      <xsl:when test="contains($vendor, 'Apache')">
+	<redirect:write file="{concat($dir,'/index.html')}">
+	  <xsl:apply-templates select="." mode="domain"/>
+	</redirect:write>
+      </xsl:when>
+    </xsl:choose>
+    <xsl:for-each select="dal:Devices/*">
+      <xsl:variable name="file" select="concat($domain,'/',@id,'.html')"/>
+      <xsl:choose>
+	<xsl:when test="contains($vendor, 'SAXON 6.2')"/>
+	<xsl:when test="contains($vendor, 'Apache')">
+	  <redirect:write file="{concat($dir,'/',@id,'.html')}">
+	    <xsl:apply-templates select=".">
+	      <xsl:with-param name="domain" select="$domain"/>
+	    </xsl:apply-templates>
+	  </redirect:write>
+	</xsl:when>
+      </xsl:choose>
+    </xsl:for-each>
+  </xsl:template>
+
+  <!-- Domain - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+
+  <xsl:template match="dal:Domain" mode="domain">
+    <html>
+      <head>
+	<title>Domain <xsl:value-of select="@id"/></title>
+      </head>
+      <body>
+	<h1>Domain <xsl:value-of select="@id"/></h1>
+	<h2>Devices</h2>
+	<ul>
+	  <xsl:apply-templates select="dal:Devices/*" mode="domain"/>
+	</ul>
+      </body>
+    </html>
+  </xsl:template>
+
+  <xsl:template match="dal:Device" mode="domain">
+    <li>
+      <xsl:element name="a">
+	<xsl:attribute name="href">
+	  <xsl:value-of select="concat(@id,'.html')"/>
+	</xsl:attribute>
+	<xsl:value-of select="dal:DeviceInfo/dal:Name"/>
+      </xsl:element>
+    </li>
+  </xsl:template>
+
+  <!-- Device - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+
+  <xsl:template match="dal:Device">
+    <xsl:param name="domain"/>
+    <html>
+      <head>
+	<title>
+	  <xsl:value-of select="$domain"/> / <xsl:value-of select="@id"/>
+	</title>
+      </head>
+      <body>
+	<xsl:text><b>Domain:</b> </xsl:text>
+	<a href="index.html"><xsl:value-of select="$domain"/></a>
+
+	<h2>Device <xsl:value-of select="dal:DeviceInfo/dal:Name"/></h2>
+
+	<dl>
+	  <dt><b>Vendor:</b></dt>
+	  <dd><xsl:value-of select="dal:DeviceInfo/dal:Vendor"/></dd>
+	  <dt><b>Device Id:</b></dt>
+	  <dd><xsl:value-of select="@id"/></dd>
+	</dl>
+
+	<xsl:apply-templates select="dal:Doc"/>
+
+	<hr/><h2>Module Summary</h2>
+
+	<ul>
+	  <xsl:for-each select="dal:Modules/*">
+	    <xsl:apply-templates select="dal:extends" mode="check"/>
+	    <li>
+	      <xsl:value-of select="@name"/>
+	      <xsl:apply-templates select="dal:extends"/>
+	    </li>
+	  </xsl:for-each>
+	</ul>
+
+	<hr/><h2>Module Detail</h2>
+
+	<xsl:apply-templates select="dal:Modules/*"/>
+
+      </body>
+    </html>
+  </xsl:template>
+
+  <!-- Modules  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                      -->
+  <!-- Determine the name of the super Module (if there is one) and use it  -->
+  <!-- to fetch a list of Action nodes in this Module. These are passed to  -->
+  <!-- the template geerating the action documentation for the module. This -->
+  <!-- This seems to be the least verbose way of getting inherited actions  -->
+  <!-- and the pattern can be used for events as well                       -->
+
+  <xsl:template match="dal:Module">
+    <xsl:variable name="dm">
+      <xsl:apply-templates select="dal:extends" mode="domain"/>
+    </xsl:variable>
+    <xsl:variable name="cl">
+      <xsl:apply-templates select="dal:extends" mode="class"/>
+    </xsl:variable>
+    <xsl:variable 
+	name="actions"
+	select="//dal:Domain[@id=$dm]//dal:ModuleClass[@name=$cl]//dal:Action"/>
+
+    <h3>
+      Module <xsl:value-of select="@name"/>
+      <xsl:apply-templates select="dal:extends"/>
+    </h3>
+    <dl>
+      <dd>
+	<xsl:apply-templates select="dal:Doc"/>
+      </dd>
+	<xsl:call-template name="do-actions">
+	  <xsl:with-param name="actions" select="$actions"/>
+	</xsl:call-template>
+    </dl>
+    <hr/>
+
+  </xsl:template>
+  
+  <!-- Actions  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                      -->
+  <!-- The do-actions template is invoked for the module, and is passed any -->
+  <!-- inherited actions in the parameter 'actions'. An action section is   -->
+  <!-- only generated if there are any actions (inherited or otherwise).    -->
+  <!-- Inherited actions are rendered before the locally defined actions    -->
+
+  <xsl:template name="do-actions">
+    <xsl:param name="actions"/>
+    <xsl:if test="count($actions)!=0 or .//dal:Actions">
+      <dt><b>Actions</b></dt>
+      <dd>
+	<dl>
+	  <xsl:apply-templates select="$actions"/>
+	  <xsl:apply-templates select=".//dal:Actions"/>
+	</dl>
+      </dd>
+    </xsl:if>
+  </xsl:template>
+
+  <xsl:template match="dal:Action">
+    <dt><b><xsl:value-of select="@name"/></b></dt>
+    <dd>
+      <xsl:apply-templates select="dal:Doc"/>
+      <dl>
+      <xsl:if test="dal:Arg">
+	<dt><b>Arguments</b></dt>
+	<xsl:apply-templates select="dal:Arg"/>
+      </xsl:if>
+      <xsl:if test="@type">
+	<dt><b>Returns</b></dt>
+	<dd><xsl:value-of select="@type"/></dd>
+      </xsl:if>
+      </dl>
+    </dd>
+  </xsl:template>
+
+  <xsl:template match="dal:Arg">
+    <dd>
+      <xsl:value-of select="@type"/> 
+      <xsl:text> </xsl:text>
+      <xsl:value-of select="@name"/> -
+      <xsl:text> </xsl:text>
+      <xsl:apply-templates select="dal:Doc"/>
+    </dd>
+  </xsl:template>
+
+  <!-- Extends  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+
+  <xsl:template match="dal:extends">
+    <xsl:text> </xsl:text><em>extends</em><xsl:text> </xsl:text>
+    <xsl:value-of select="@class"/><xsl:text> (</xsl:text>
+    <xsl:value-of select="@domain"/><xsl:text>)</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="dal:extends" mode="domain">
+    <xsl:value-of select="@domain"/>
+  </xsl:template>
+
+  <xsl:template match="dal:extends" mode="class">
+    <xsl:value-of select="@class"/>
+  </xsl:template>
+
+  <xsl:template match="dal:extends" mode="check">
+    <xsl:variable name="domain" select="@domain"/>
+    <xsl:variable name="class" select="@class"/>
+    <xsl:variable 
+	name="extends" 
+	select="//dal:Domain[@id=$domain]//dal:ModuleClass[@name=$class]"/>
+    <xsl:if test="count($extends)=0">
+      <xsl:message terminate="yes">
+	<xsl:text>Imported module class </xsl:text>
+	<xsl:value-of select="$domain"/>:<xsl:value-of select="$class"/>
+	<xsl:text> not found</xsl:text>
+      </xsl:message>
+    </xsl:if>
+  </xsl:template>
+  
+  <!-- Documentation  - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+
+  <xsl:template match="dal:em">
+    <em><xsl:apply-templates/></em>
+  </xsl:template>
+
+  <xsl:template match="dal:b">
+    <b><xsl:apply-templates/></b>
+  </xsl:template>
+
+  <xsl:template match="dal:p">
+    <p><xsl:apply-templates/></p>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/SDT/schema4.0/test/EchonetLiteExamples.xml b/SDT/schema4.0/test/EchonetLiteExamples.xml
new file mode 100644
index 0000000000000000000000000000000000000000..76f7d8451fae82a4eada7a8cf527d7bc418c2042
--- /dev/null
+++ b/SDT/schema4.0/test/EchonetLiteExamples.xml
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<!-- Example SDT definition taken from EchonetLite https://github.com/ECHONET-Consortium -->
+
+
+<Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	id="example.based.on.echonetLite">
+
+  <!-- Various examples for module classes -->
+
+	<Modules>
+		<ModuleClass name="operationStatus">
+			<Data>
+				<DataPoint name="operationStatus" readable="true" writable="true">
+					<Doc>This property indicates the ON/OFF status.</Doc>
+					<DataType>
+						<SimpleType type="boolean" />
+					</DataType>
+				</DataPoint>
+			</Data>
+		</ModuleClass>
+
+  	<!-- runtime property -->
+
+		<ModuleClass name="installationLocation">
+			<Data>
+				<DataPoint name="installationLocation" readable="true" writable="true">
+					<Doc>This property indicates the installation location</Doc>
+					<DataType>
+						<SimpleType type="string" />
+					</DataType>
+				</DataPoint>
+			</Data>
+			<Events>
+				<Event name="installationLocation">
+					<!-- Event payload not shown here -->
+				</Event>
+			</Events>
+		</ModuleClass>
+
+  	<!-- sensor readout -->
+
+		<ModuleClass name="measuredInstantaneousPowerConsumption">
+			<Data>
+				<DataPoint name="measuredInstantaneousPowerConsumption" readable="true" writable="false">
+					<Doc>This property indicates the instantaneous power consumption of the device in watts.</Doc>
+					<DataType unitOfMeasure="watts">
+						<SimpleType type="integer" />
+					</DataType>
+				</DataPoint>
+			</Data>
+		</ModuleClass>
+
+		<ModuleClass name="temperatureSensorDataPoints">
+			<Data>
+				<DataPoint name="measuredTemperatureValue" readable="true" writable="false">
+					<Doc>This property indicates the measured temperature value in units of 0.1C.</Doc>
+					<DataType unitOfMeasure="celsius">
+						<SimpleType type="integer" />
+					</DataType>
+				</DataPoint>
+			</Data>
+		</ModuleClass>
+	</Modules>
+	
+
+  <!-- Very simple example for a washing machine definition -->
+
+	<Devices>
+		<Device id="SimpleWaschingMachine">
+			<Properties>
+				<Property name="Name" value="washing machine">
+					<SimpleType type="string" />
+				</Property>
+				<Property name="Vendor" value="ACME">
+					<SimpleType type="string" />
+				</Property>
+			</Properties>
+
+			<Modules>
+				
+				<!-- Inheriting ModuleClasses from the global generic ModuleClasses -->
+
+				<Module name="installationLocation">
+					<extends domain="example.based.on.echonetLite" class="installationLocation"/>
+				</Module>
+
+				<Module name="measuredInstantaneousPowerConsumption">
+					<extends domain="example.based.on.echonetLite" class="measuredInstantaneousPowerConsumption"/>
+				</Module>
+
+				<Module name="temperatureSensorDataPoints">
+					<extends domain="example.based.on.echonetLite" class="temperatureSensorDataPoints"/>
+				</Module>
+
+
+				<!-- The following Module inherits and extends a global generic 		 ModuleClass with an event. Therefore, it is renamed to express
+					 the change of name. -->
+
+				<Module name="washingMachineOperationStatus">
+					<extends domain="example.based.on.echonetLite" class="operationStatus"/>
+
+					<!-- This Module extends the global one with an event. -->
+
+					<Events>
+						<Event name="washingMachineOperationStatus">
+							<!-- Event payload not shown here -->
+						</Event>
+					</Events>
+
+				</Module>
+
+
+				<!-- Data points local to the washing machine device -->
+
+				<Module name="washingMachineDataPoints">
+					<Data>
+						<DataPoint name="door/CoverOpen/CloseStatus" readable="true" writable="false">
+							<Doc>This property indicates whether the door/cover is open or closed.</Doc>
+							<DataType>
+								<SimpleType type="enum" />
+							</DataType>
+						</DataPoint>
+						<DataPoint name="washingMachineSetting" readable="true" writable="true">
+							<Doc>Washing machine setting</Doc>
+							<DataType>
+								<SimpleType type="enum" />
+							</DataType>
+						</DataPoint>
+						<DataPoint name="currentStageOfWashingCycle" readable="true" writable="false">
+							<Doc>This property indicates the current stage of the washing cycle.</Doc>
+							<DataType>
+								<SimpleType type="enum" />
+							</DataType>
+						</DataPoint>
+						<DataPoint name="timeRemainingToCompleteWashingCycle" readable="true" writable="false">
+							<Doc>This property indicates the time remaining to complete the current washing cycle in the HH:MM:SS format.</Doc>
+							<DataType>
+								<SimpleType type="time" />
+							</DataType>
+						</DataPoint>
+
+						<!-- These three data points actually would make a good 
+							 example to be moved to a separate ModuleClass for
+							 generalization so that they can be used by any device
+							 that would make use of a timer. -->
+
+						<DataPoint name="onTimerReservationSetting" readable="true" writable="true">
+							<Doc>Reservation ON/OFF</Doc>
+							<DataType>
+								<SimpleType type="enum" />
+							</DataType>
+						</DataPoint>
+						<DataPoint name="onTimerSetting" readable="true" writable="true">
+							<Doc>Timer value (HH:MM)</Doc>
+							<DataType>
+								<SimpleType type="time" />
+							</DataType>
+						</DataPoint>
+						<DataPoint name="relativeTimeBasedOnTimerSetting" readable="true" writable="true">
+							<Doc>Timer value (HH:MM)</Doc>
+							<DataType>
+								<SimpleType type="time" />
+							</DataType>
+						</DataPoint>
+						
+					</Data>
+				</Module>
+			</Modules>
+		</Device>
+	</Devices>
+</Domain>
diff --git a/SDT/schema4.0/test/dal-core.xml b/SDT/schema4.0/test/dal-core.xml
new file mode 100644
index 0000000000000000000000000000000000000000..65ec652d501ec799914a79bafa998b557b28791b
--- /dev/null
+++ b/SDT/schema4.0/test/dal-core.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0" 
+	id="hgi.dal.core">
+
+	<Modules>
+		<ModuleClass name="BooleanState">
+			<Doc>
+				<tt>BooleanState</tt> is the preferred module for modelling a
+				functionality corresponding to an underlying binary state. This
+				module should be used to abstract away from the actual datatype
+				and values in question. Note that the module does not define whether
+				the execution mode is blocking or non-blocking.
+				</Doc>
+			<Actions>
+				<Action name="get">
+					<Doc>Obtain the current associated state.</Doc>
+					<DataType>
+						<SimpleType type="boolean" />
+					</DataType>
+				</Action>
+				<Action name="setTarget">
+					<Doc>Set the associated state to the specified value.</Doc>
+					<Args>
+						<Arg name="value">
+							<Doc>The desired value of the associated state.</Doc>
+							<DataType>
+								<SimpleType type="boolean" />
+							</DataType>
+						</Arg>
+					</Args>
+				</Action>
+			</Actions>
+		</ModuleClass>
+	</Modules>
+
+</Domain>
diff --git a/SDT/schema4.0/test/dal-eg.xml b/SDT/schema4.0/test/dal-eg.xml
new file mode 100644
index 0000000000000000000000000000000000000000..60a5b87029febb0e4fecadef0c8104741fb24517
--- /dev/null
+++ b/SDT/schema4.0/test/dal-eg.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<Domain xmlns:xi="http://www.w3.org/2001/XInclude"
+	xmlns="http://homegatewayinitiative.org/xml/dal/3.0" 
+	id="com.telekom">
+
+  <Imports>
+    <xi:include href="./dal-core.xml" parse="xml" />
+  </Imports>
+
+  <Devices>
+
+    <Device id="switch.power">
+      
+      <Doc>
+	This device is intended as a demonstration of how to use the
+	abstract modules defined in the <em>HGI Core</em> domain. The
+	vendor has provided a proprietry module with two operations
+	<tt>on</tt> and <tt>off</tt>. This is clearly a candidate for the 
+	module class <tt>BooleanState</tt>.
+      </Doc>
+      <Properties>
+      	<Property name="Name">
+		  <Doc>Original value: PowerSwitch</Doc>
+		  <SimpleType type="string" />
+		</Property>
+
+		<!-- The Vendor field should probably be part of the domain -->
+      	<Property name="Vendor">
+      	  <Doc>Original value: Telekom Innovation Laboratories</Doc>
+	  	  <SimpleType type="string" />
+		</Property>
+      </Properties>
+
+      <Modules>
+	<Module name="proprietaryPower">
+	  <Doc>
+	    The proprietry interface for turning the switch on and off. 
+	    Actions for setting the state to <tt>on</tt> or <tt>off</tt> 
+	    and for querying the state.
+	  </Doc>
+
+	  <Actions>
+	    <Action name="on">
+	      <Doc>
+		Turn the switch on.
+	      </Doc>
+	    </Action>
+	    <Action name="off">
+	      <Doc>
+		Turn the switch off.
+	      </Doc>
+	    </Action>
+	    <Action name="state">
+		  	<Doc>Query the state of the switch. Returns the string "<tt>on</tt>" or "<tt>off</tt>".</Doc>
+		  	<DataType>
+	           	<SimpleType type="string" />
+	        </DataType>
+	    </Action>
+	  </Actions>
+
+	  <Events>
+	  	<Event name="switchEvent">
+		  <Doc>An event that indicates the new state of the switch.
+		  </Doc>
+		  <Data>
+		    <DataPoint name="state" writable="false">
+		      <DataType>
+		          <SimpleType type="boolean" />
+		      </DataType>
+	 		</DataPoint>
+		  </Data>
+	  	</Event>
+	  </Events>
+	</Module>
+
+	<Module name="power">
+	  <extends domain="hgi.dal.core" class="BooleanState"/>
+	</Module>
+      </Modules>
+    </Device>
+  </Devices>
+</Domain>
diff --git a/SDT/schema4.0/test/example1.SDT.xml b/SDT/schema4.0/test/example1.SDT.xml
new file mode 100644
index 0000000000000000000000000000000000000000..fb922d8948fba620499300c4757d5c1ee404c147
--- /dev/null
+++ b/SDT/schema4.0/test/example1.SDT.xml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Example1 SDT inspired by some Echonet Lite examples -->
+<Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	id="example1.SDT">
+
+	<Modules>
+
+		<!-- Various examples for module classes -->
+		<ModuleClass name="operationStatus">
+			<Data>
+				<DataPoint name="operationStatus" writable="true">
+					<Doc>This property sets the ON/OFF status.</Doc>
+						<DataType>
+							<SimpleType type="boolean"/> 
+						</DataType>
+				</DataPoint>
+			</Data>
+			<Events>
+				<Event name="operationStatus">
+				</Event>
+			</Events>
+		</ModuleClass>
+
+
+		<ModuleClass name="installationLocation">
+			<Data>
+				<DataPoint name="installationLocation" writable="true">
+					<Doc>This property indicates the installation location</Doc>
+					<DataType>
+						<SimpleType type="string"/>
+					</DataType>
+				</DataPoint>
+			</Data>
+			<Events>
+				<Event name="installationLocation"> </Event>
+			</Events>
+		</ModuleClass>
+
+		<ModuleClass name="measuredCumulativePowerConsumption">
+			<Data>
+				<DataPoint name="measuredCumulativePowerConsumption" writable="false">
+					<Doc>This indicates cumulative power consumption of the device in increments of 0.001kWh.</Doc>
+					<DataType unitOfMeasure="watt">
+						<SimpleType type="integer"/>
+					</DataType>
+				</DataPoint>
+			</Data>
+		</ModuleClass>
+
+		<ModuleClass name="onTimerSetting">
+			<Data>
+				<DataPoint name="onTimer" writable="true">
+					<Doc>Timer value (HH:MM)</Doc>
+					<DataType>
+						<SimpleType type="time"/>
+					</DataType>
+				</DataPoint>
+			</Data>
+		</ModuleClass>
+
+		<ModuleClass name="statusDoor">
+			<Data>
+				<DataPoint name="statusDoor" writable="false">
+					<Doc>This reads the open=true or closed=false status of a door </Doc>
+					<DataType>
+						<SimpleType type="boolean"/>
+					</DataType>
+				</DataPoint>
+			</Data>
+		</ModuleClass>
+
+	</Modules>
+
+</Domain>
diff --git a/SDT/schema4.0/test/example2.SDT.xml b/SDT/schema4.0/test/example2.SDT.xml
new file mode 100644
index 0000000000000000000000000000000000000000..82090f7174a241b2fe3f9912cc88dabb236af38e
--- /dev/null
+++ b/SDT/schema4.0/test/example2.SDT.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Example1 SDT inspired by some Echonet Lite examples -->
+<Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	id="example2.SDT">
+
+    <Imports>
+        <xi:include href="./example1.SDT.xml" parse="xml" />
+    </Imports>
+
+	<Devices>
+		<Device id="airConditioner">
+			<Modules>
+				<Module name="operationStatus">
+					<extends domain="example1.SDT" class="operationStatus"/>
+				</Module>
+				<Module name="installationLocation">
+					<extends domain="example1.SDT" class="installationLocation"/>
+				</Module>
+				<Module name="measuredCumulativePowerConsumption">
+					<extends domain="example1.SDT" class="measuredCumulativePowerConsumption"/>
+				</Module>
+				<Module name="measuredCumulativePowerConsumption">
+					<extends domain="example1.SDT" class="measuredCumulativePowerConsumption"/>
+				</Module>
+				<Module name="onTimerSetting">
+					<extends domain="example1.SDT" class="onTimerSetting"/>
+				</Module>
+			</Modules>
+		</Device>
+	</Devices>
+</Domain>
\ No newline at end of file
diff --git a/SDT/schema4.0/test/example3.SDT.xml b/SDT/schema4.0/test/example3.SDT.xml
new file mode 100644
index 0000000000000000000000000000000000000000..cb3c1836f61578cfb6103d9eae2e5a9183f61967
--- /dev/null
+++ b/SDT/schema4.0/test/example3.SDT.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!-- Example1 SDT inspired by some Echonet Lite examples -->
+<Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
+	xmlns:xi="http://www.w3.org/2001/XInclude"
+	id="example3.SDT">
+
+    <Imports>
+        <xi:include href="./example1.SDT.xml" parse="xml" />
+    </Imports>
+
+	<Devices>
+		<Device id="waschingMachine">
+			<Modules>
+				<Module name="operationStatus">
+					<extends domain="example1.SDT" class="operationStatus"/>
+				</Module>
+				<Module name="installationLocation">
+					<extends domain="example1.SDT" class="installationLocation"/>
+				</Module>
+				<Module name="measuredCumulativePowerConsumption">
+					<extends domain="example1.SDT" class="measuredCumulativePowerConsumption"/>
+				</Module>
+				<Module name="measuredCumulativePowerConsumption">
+					<extends domain="example1.SDT" class="measuredCumulativePowerConsumption"/>
+				</Module>
+				<Module name="onTimerSetting">
+					<extends domain="example1.SDT" class="onTimerSetting"/>
+				</Module>
+				<Module name="statusDoor">
+					<extends domain="example1.SDT" class="statusDoor"/>
+				</Module>
+			</Modules>
+		</Device>
+	</Devices>
+</Domain>
\ No newline at end of file
diff --git a/SDT/schema4.0/test/mseeb.xml b/SDT/schema4.0/test/mseeb.xml
new file mode 100644
index 0000000000000000000000000000000000000000..04dacf7655c7b11878c841b925df595adcf44ba8
--- /dev/null
+++ b/SDT/schema4.0/test/mseeb.xml
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<!--tabstop: 4 -->
+
+<!--
+
++................................................+
+:Domain:org.homegatewayinitiative                                  :
+:                                                :
+:  +..........................................+  :
+:  :Module:BooleanState                       :  :
+:  :                                          :  :
+:  :  +....................................+  :  :
+:  :  :Action:get                          :  :  :
+:  :  +....................................+  :  :
+:  :                                          :  :
+:  :  +....................................+  :  :
+:  :  :Action:setTarget                    :  :  :
+:  :  +....................................+  :  :
+:  +..........................................+  :
+:                                                :
+:  +..........................................+  :
+:  :Device:MSEEB.root                         :  :
+:  :                                          :  :
+:  :  +....................................+  :  :
+:  :  :Module<REF>:BooleanState            :  :  :
+:  :  +....................................+  :  :
+:  :                                          :  :
+:  :  +....................................+  :  :
+:  :  :Module:extensionBlockDataPoints     :  :  :
+:  :  :                                    :  :  :
+:  :  :  +..............................+  :  :  :
+:  :  :  :DataPoint:firmwareVersion     :  :  :  :
+:  :  :  +..............................+  :  :  :
+:  :  :                                    :  :  :
+:  :  :  +..............................+  :  :  :
+:  :  :  :DataPoint:powerSwitchNames    :  :  :  :
+:  :  :  +..............................+  :  :  :
+:  :  +....................................+  :  :
+:  :                                          :  :
+:  :  +....................................+  :  :
+:  :  :SubDevices                          :  :  :
+:  :  :                                    :  :  :
+:  :  :  +..............................+  :  :  :
+:  :  :  :SubDevice:switch.power.1      :  :  :  :
+:  :  :  :                              :  :  :  :
+:  :  :  :+...........................+ :  :  :  :
+:  :  :  ::Module<REF>:BooleanState   : :  :  :  :
+:  :  :  :+...........................+ :  :  :  :
+:  :  :  +..............................+  :  :  :
+:  :  :                                    :  :  :
+:  :  :  +..............................+  :  :  :
+:  :  :  :SubDevice:switch.power.2      :  :  :  :
+:  :  :  :                              :  :  :  :
+:  :  :  :+...........................+ :  :  :  :
+:  :  :  ::Module<REF>:BooleanState   : :  :  :  :
+:  :  :  :+...........................+ :  :  :  :
+:  :  :  +..............................+  :  :  :
+:  :  +....................................+  :  :
+:  +..........................................+  :
++................................................+
+
+-->
+<Domain xmlns:xi="http://www.w3.org/2001/XInclude"
+    xmlns="http://homegatewayinitiative.org/xml/dal/3.0" 
+    id="org.homegatewayinitiative">
+
+<!-- The following import statements include ModuleClasses from HGI -->
+
+    <Imports>
+        <xi:include href="./dal-core.xml" parse="xml" />
+    </Imports>
+
+    <Modules>
+        <ModuleClass name="BooleanState">
+            <Doc>
+                <tt>BooleanState</tt> is the preferred module for modelling a functionality corresponding to an underlying binary state.This module should be used to abstract away from the actual datatype and values in question. Note that the module does not define whether the execution mode is blocking or non-blocking.
+            </Doc>
+            <Actions>
+                <Action name="get" optional="true">
+                    <Doc>
+                        Obtain the current associated state.
+                    </Doc>
+                    <DataType>
+                        <SimpleType type="boolean" />
+                    </DataType>
+                </Action>
+                <Action name="setTarget">
+                    <Doc>
+                        Set the associated state to the specified value.
+                    </Doc>
+                    <Args>
+                        <Arg name="value">
+                            <Doc>
+                            The desired value of the associated state.
+                            </Doc>
+                            <DataType>
+                                <SimpleType type="boolean" />
+                            </DataType>
+                        </Arg>
+                    </Args>
+                </Action>
+          </Actions>
+          <Events>
+                <Event name="stateChanged" optional="true">
+                    <Data>
+                        <DataPoint name="state" readable="true">
+                            <DataType>
+                        		<SimpleType type="boolean" />
+                            </DataType>
+                        </DataPoint>
+                    </Data>
+                </Event>      
+          </Events>
+        </ModuleClass>
+    </Modules>
+
+<!-- Definition of the Device starts here. -->
+
+    <Devices>
+
+<!-- The Device contains several sub-devices and offers one action on its own. -->
+
+        <Device id="MSEEB.root">
+            <Doc>
+                This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
+            </Doc>
+            <Properties>
+                <Property name="Name">
+                    <Doc>Original value: Multi Socket Electrical-Extension-Block</Doc>
+                    <SimpleType type="string" />
+                </Property>
+                <Property name="Vendor">
+                    <Doc>Original value: HGI</Doc>
+                    <SimpleType type="string" />
+                </Property>
+                <Property name="FirmwareVersion">
+                  <Doc>Original value: 1.0</Doc>
+                  <SimpleType type="string" />
+                </Property>
+                <Property name="VendorURL">
+                  <Doc>Original value: http://www.homegatewayinitative.org</Doc>
+                  <SimpleType type="uri" />
+                </Property>
+                <Property name="SerialNumber">
+                  <Doc>Original value: 1234.5</Doc>
+                  <SimpleType type="string" />
+                </Property>
+            </Properties>
+
+<!-- These are the modules for the device:
+    - Switch on/off all contained switches. It inherits from hgi.dal.core.BooleanState.
+    - A module with some data points for the firmware version of the whole device and a list of names of the containted power switches.
+-->
+
+            <Modules>
+                <Module name="rootPowerOnOff" optional="true">
+                    <extends domain="hgi.dal.core" class="BooleanState"/>
+                    <Doc>
+                        The proprietry interface for turning all switches of the extension block on and off. 
+                        The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false".
+                    </Doc>
+                    <Properties>
+                        <Property name="version" value="1.0.0">
+                            <Doc>Version for this ModuleClass</Doc>
+                            <SimpleType type="string" />
+                        </Property>
+                    </Properties>
+                </Module>
+                <Module name="power">
+                    <Actions>
+                    	<Action name="getPowerConsumption">
+                            <Doc>Get the power consumption.</Doc>
+                            <DataType name="consumption">
+                    			<Struct>
+                                    <DataType name="values">
+                        				<Array>
+                                           <DataType>
+                                                <Doc>This is an example simple data type with a minimum-value constraint.</Doc>
+                            					<SimpleType type="float" />
+                                                <Constraints>
+                                                    <Constraint name="minValue" type="float" value="0.0">
+                                                        <Doc>The value must be equal or greater 0.0</Doc>
+                                                    </Constraint>
+                                                      <Constraint name="step" type="float" value="0.1">
+                                                        <Doc>Steps are 0.1</Doc>
+                                                    </Constraint>
+                                                </Constraints>
+                                            </DataType>
+                				        </Array>
+                                    </DataType>
+                                    <DataType name="timeFrame">
+                        				<Array>
+                                            <DataType>
+                            					<SimpleType type="datetime" />
+                                            </DataType>
+                				        </Array>
+                                    </DataType>
+                                </Struct>
+                            </DataType>
+                    	</Action>
+                    </Actions>
+                </Module>
+
+                <Module name="extensionBlockDataPoints">
+                    <Actions>
+                        <Action name="getNames">
+                            <DataType name="names">
+                                <Array>
+                                    <DataType>
+                                        <SimpleType type="string" />
+                                    </DataType>
+                                </Array>
+                            </DataType>
+                        </Action>
+                    </Actions>
+                    <Data>
+                        <DataPoint  name="firmwareVersion" 
+                                    writable="false"
+                                    readable="true">
+                            <Doc>
+                                This datapoint represents the firmware version of the extension block.
+                            </Doc>
+                            <DataType>
+                                <SimpleType type="string" />
+                            </DataType>
+                        </DataPoint>
+                        
+                        <DataPoint  name="powerSwitchNames"
+                                    writable="false"
+                                    readable="true">
+                            <Doc>
+                                This datapoint is an array of strings with the names of the contained devices.
+                            </Doc>
+                            <DataType>
+                                <Array>
+                                    <DataType>
+                                        <SimpleType type="string" />
+                                    </DataType>
+                                </Array>
+                            </DataType>
+                        </DataPoint>
+                    </Data>
+                </Module>
+            </Modules>
+
+<!-- Definition of sub-devices starts here. -->
+
+            <SubDevices>
+
+<!-- This is the first power switch of the extension block. For sake of simplicity no new ModuleClasses are defined, but only referenced.
+-->
+
+                <SubDevice id="switch.power.1">
+                    <Doc>
+                        This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
+                    </Doc>
+                    <Properties>
+                        <Property name="Name" value="PowerSwitch 1">
+                            <SimpleType type="string" />
+                        </Property>
+                        <Property name="Vendor" value="HGI">
+                            <SimpleType type="string" />
+                        </Property>
+                    </Properties>
+                    <Modules>
+                        <Module name="power">
+                            <extends domain="hgi.dal.core" class="BooleanState"/>
+                        </Module>
+                    </Modules>
+                </SubDevice>
+
+<!-- This is the second power switch of the extension block. -->
+
+                <SubDevice id="switch.power.2">
+                    <Doc>
+                        This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
+                    </Doc>
+                    <Properties>
+                        <Property name="Name" value="PowerSwitch 2">
+                            <SimpleType type="string" />
+                        </Property>
+                        <Property name="Vendor" value="HGI">
+                            <SimpleType type="string" />
+                        </Property>
+                        <Property name="VendorURL" value="http://homegatwaysinitiative.org">
+                            <SimpleType type="uri" />
+                        </Property>
+                        <Property name="maximumAltitude" value="2800">
+                            <SimpleType type="integer" />
+                        </Property>
+                    </Properties>
+                    <Modules>
+                        <Module name="power">
+                            <extends domain="hgi.dal.core" class="BooleanState"/>
+                        </Module>
+                    </Modules>
+                </SubDevice>
+
+            </SubDevices>
+
+        </Device>
+    </Devices>
+</Domain>